Hi
What is the code for accessing the oullook outbox from within vb
i can send a mail, but would like to be able to check the out and inboxes.
thank you in advance
Si
:)
Printable View
Hi
What is the code for accessing the oullook outbox from within vb
i can send a mail, but would like to be able to check the out and inboxes.
thank you in advance
Si
:)
Remember, that in Outlook the "Outbox" is a very temporary folder. Items get placed in there when the user presses Send. Then the mail message is transmitted and the item is re-filed into the Sent Items folder.
This bit of code might help....
I have declared "MyItem" as an Outlook message, as then you can use the Object Browser in the VB development environment to see what other fields are possible.VB Code:
Dim myItem As Outlook.MailItem Set NameSpace = Outlook.GetNamespace("MAPI") Set myFolder = NameSpace.GetDefaultFolder(6) ' 6 = Inbox. 4 = Outbox. 5 = Sent Items MsgBox "Looking at the first item in " & myFolder Set myMsgs = myFolder.Items For Each myItem In myMsgs MsgBox "Message " & _ myItem.To & " " & _ myItem.Subject & " " & _ myItem.Body & " " & _ myItem.CreationTime & " " & _ myItem.Sent Exit For Next For Each myItem In myMsgs myItem.Display Exit For Next