Retrieving emails from a special outlook folder
Posted: Fri Jan 13, 2017 2:57 am
Hi again,
a customer wants us to retrieve emails that are in a special outlook folder.
Background is:
But at the end they define objects as type "object" which is not possible in LANSA VL in order to save the informations that are related with all the seperate mails. These mail informations seem to have a special defined fields structure and the "object" type fields receive this structure automatically by getting allocated to the MAPI component.
The following is a simple VBA code to retrieve 1 single mail in a default folder - can you help me to reproduce this with VL? I get this working in VL up to the statement next to last where "myItem" is used - and this is defined as type "object".
Many thanks in advance,
Joerg
a customer wants us to retrieve emails that are in a special outlook folder.
Background is:
- We have a large database with more than 10000 email addresses on IBMi
Now we will automatically send an email to all those to ask them if they are interested in advertisment
If not they shall send the mail back to a special mail address and all these mails will be posted in an "unsubscribe" folder in Outlook
And then we have to retrieve these messages and the sender addresses and mark their email addresses in the IBMi database correspondingly.
But at the end they define objects as type "object" which is not possible in LANSA VL in order to save the informations that are related with all the seperate mails. These mail informations seem to have a special defined fields structure and the "object" type fields receive this structure automatically by getting allocated to the MAPI component.
The following is a simple VBA code to retrieve 1 single mail in a default folder - can you help me to reproduce this with VL? I get this working in VL up to the statement next to last where "myItem" is used - and this is defined as type "object".
Code: Select all
Sub GetItem()
Dim myNameSpace As Outlook.NameSpace
Dim myFolder As Outlook.Folder
Dim myItem As Object
Set myNameSpace = Application.GetNameSpace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)
Set myItem = myFolder.Items(1)
myItem.Display
End subJoerg