Does anyone know how to extract a line of information from the body of an email in Outlook and place it in a targeted cell in an Excel worksheet? I'm trying to piece together a macro, but no dice so far =P
'This code should show you how to access Outlook 2000 and retrieve some data. Use defaultfolder #6 and go to the message body to retrieve the line.
Do you know how to open an Excel app via vbscript?
Set appOutl = Wscript.CreateObject("Outlook.Application"
Set objSession = appOutl.GetNameSpace("MAPI"
objSession.Logon Profile_Name_Here
' Set MyItem to the collection of items in the folder.
Set myItems = myFolder.Items
' Loop through all of the items in the folder.
For I = 1 to MyFolder.Items.Count
MsgBox MyItems(I).subject
MsgBox MyItems(I).body
Next
' *** Contacts Folder
Set MyFolder = objSession.GetDefaultFolder(10)
Msgbox MyFolder.name & ", " & MyFolder.Items.Count
Set myItems = myFolder.Items.Restrict("[MessageClass] = 'IPM.Contact'"
For I = 1 to MyFolder.Items.Count
MsgBox MyItems(I).FullName
Next
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.