HIDE ITEM

Status
Not open for further replies.

oliv-

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Hi,
Is there a way to hide an item ?
I want to use a mailitem as parameters for an ADDIN
 
Thank you , I will test it.
 
it's ok !

Code:
Sub AssignStorageData()
    Dim oInbox As Outlook.Folder
    Dim myStorage As Outlook.StorageItem

    Set oInbox = Application.Session.GetDefaultFolder(olFolderInbox)
    ' Get an existing instance of StorageItem, or create new if it doesn't exist
    Set myStorage = oInbox.GetStorage("My Private Storage", olIdentifyBySubject)
    ' If StorageItem is new, add a custom property for Order Number
    If myStorage.Size = 0 Then
        myStorage.UserProperties.add "Order Number", olNumber
    End If
    ' Assign a value to the custom property
    myStorage.UserProperties("Order Number").Value = 100
    myStorage.Save
End Sub

Sub getXlListStorageItem()
    Dim oInbox As Outlook.Folder
    Dim criteria
    Dim oTable
    Dim i, oRow
    Set oInbox = Application.Session.GetDefaultFolder(olFolderInbox)
    criteria = "[MessageClass]='IPM.Storage'"
    Set oTable = oInbox.GetTable(criteria, olHiddenItems)

    MsgBox oTable.GetRowCount

    Dim appExcel As Excel.Application
    Set appExcel = CreateObject("Excel.application")
    appExcel.Visible = True
    appExcel.Workbooks.add

    i = 2
    'Enumerate the table using test for EndOfTable
    Do Until (oTable.EndOfTable)

        Set oRow = oTable.GetNextRow()
        appExcel.Cells(i, 1).Value = (oRow("Subject"))
        appExcel.Cells(i, 2).Value = (oRow("Subject"))
        appExcel.Cells(i, 3).Value = (oRow("MessageClass"))
        appExcel.Cells(i, 4).Value = (oRow("CreationTime"))
        appExcel.Cells(i, 5).Value = (oRow("LastModificationTime"))
        i = i + 1
    Loop
End Sub

Sub test_getStorageItem()
    Dim myStorageItem As Outlook.StorageItem
    Set myStorageItem = getStorageItem("My Private Storage")
    MsgBox myStorageItem.Subject & vbCr & "attachments = " & myStorageItem.Attachments.Count _
         & vbCr & "Order Number=" & myStorageItem.UserProperties("Order Number")
    Set myStorageItem = Nothing
End Sub

Function getStorageItem(Subject) As Outlook.StorageItem
    Dim oInbox As Outlook.Folder
    Dim oTable As Outlook.Table
    Dim oRow
    Dim criteria
    Set oInbox = Application.Session.GetDefaultFolder(olFolderInbox)
    criteria = "[MessageClass]='IPM.Storage'"
    Set oTable = oInbox.GetTable(criteria, olHiddenItems)

    'Enumerate the table using test for EndOfTable
    Do Until (oTable.EndOfTable)
        Set oRow = oTable.GetNextRow()
        If oRow("Subject") = Subject Then
            Set getStorageItem = Application.Session.GetItemFromID(oRow("EntryID"))
            Exit Do
        End If
    Loop
    Set oInbox = Nothing
    Set oTable = Nothing
    Set oRow = Nothing
End Function
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
J Hide/Disable the X button on BrowseForFolder Dialog Using Outlook 4
J Hide/disable "Groups", "Shared Calendars" Using Outlook 2
D hide messege issue Using Outlook 1
J Outlook 2007 Hide Messages Option not Available Using Outlook 2
N How to disable shortcuts for Pilcrow in Outlook (Show or hide paragraph marks) Using Outlook 0
A Possible to hide ribbon with custom appointment form? Outlook VBA and Custom Forms 3
D Disable or hide "reply" and "reply to all" and "forward" in email from access vba Outlook VBA and Custom Forms 1
K BCM hide subfolders BCM (Business Contact Manager) 1
S Hide Timestamp from deleyed message Using Outlook 4
I Outlook 2010 - Remove or Hide Suggested Contact Folders Using Outlook 1
K Hide Default Folders in PST Using Outlook 2
F Hide calendars from shared mailboxes Using Outlook 2
J Ho do I hide the week number on the Calendar Printing Assistant template Using Outlook 4
S Hide Folders in Outlook 2007 (IMAP) Using Outlook 5
C How do I hide distribution list from global contacts for certain users? Exchange Server Administration 1
T Is it possible to hide a mailbox but still send on the behalf of. Exchange Server Administration 1
H Outlook 2007 - hide completed tasks from Outlook Today -Solution Using Outlook 2
N Appointment Body on Custom Page 2- Hide Default Page Outlook VBA and Custom Forms 2
N How to hide pstStore Outlook VBA and Custom Forms 4
H Hide attachment... Outlook VBA and Custom Forms 3
S hide details of appointments in calendar Using Outlook 8
M hide outlook to system tray Outlook VBA and Custom Forms 1
E Can I hide an explorer or make an explorer modal Outlook VBA and Custom Forms 2
E Can I hide an explorer or make an explorer modal Outlook VBA and Custom Forms 2
J How to hide/disable send button in Outlook 2007 Outlook VBA and Custom Forms 1
J How to hide/disable send button in Outlook 2007 Outlook VBA and Custom Forms 2
J How to hide/disable send button in Outlook 2007 Outlook VBA and Custom Forms 1
C Re: Hide BCM toolbar BCM (Business Contact Manager) 1
T How do I hide/unhide folders in outlook inbox? BCM (Business Contact Manager) 1
G Outlook Contact Item.Restrict where FullName is NULL Outlook VBA and Custom Forms 3
T Outlook365 search item listed as "potential matches" can't be opened Using Outlook 0
H Outlook 365 O365 outlook calendar item editing Using Outlook 1
P "Item could not be moved" message occurs frequently for IMAP inbox, Office 365 Using Outlook 0
V How to add 'Previous Item' and 'Next Item' to the Quick Access Toolbar Using Outlook 1
O In Agenda-view - How to copy an existing item months ahead or back? Using Outlook 0
S Outlook 2016 dont delete inbox item Using Outlook 0
talla Can't open Outlook Item. Using Outlook 0
N Item cannot be saved because it was modified by another user or window, and, Item could not be moved... Using Outlook 0
B Zoom automatically next email item (VBA) Outlook VBA and Custom Forms 2
S Command Button_Click action on Item/Reminder Outlook VBA and Custom Forms 3
A Unflag Inbox and Flag Inbox with Orange Category After Item is send Outlook VBA and Custom Forms 3
A Run-time error '430' on certain emails when trying to set "Outlook.mailitem" as "ActiveExplorer.Selection.Item" Outlook VBA and Custom Forms 2
C Copy Move item won't work Outlook VBA and Custom Forms 2
T Pictures degrade each time an Outlook item is edited and re-saved Using Outlook 1
B Change row background color of selected item Using Outlook 1
P Outlook 2013 "Item could not be moved - still an issue for Outlook 2013 Using Outlook 0
R Error when trying to forward current email item Outlook VBA and Custom Forms 7
geoffnoakes Find Contacts with UDFs "in this item" Using Outlook 1
T "cannot find the calendar folder for this item" - calendar items stuck in outbox Using Outlook 0
GregS Many Sent Item folders Using Outlook 3

Similar threads

Back
Top