I have the following code to copy attachments out of email in the inbox and it works.
What I want to do is copy attachments out of another folder.
How and where do i specify that outlook folder?
Any help is greatly appreciated.
AddExtender("wwfaf44i.dll")
olFolderInbox=6
SaveTo = "C:\docstoprint\"
MSapp = ObjectCreate ("Outlook.Application")
oNameSpace = MSapp.GetNamespace("MAPI")
oFolder = oNameSpace.GetDefaultFolder(olFolderInbox)
oFolderItems=oFolder.Items
msgcount = oFolderItems.count
For a = 1 to msgcount
oMessage = oFolderItems.Item(a)
oAttachments = oMessage.Attachments
attachcount = oAttachments.Count
For b = 1 to attachcount
oAttachItem = oAttachments.Item(b)
fname = oAttachItem.filename
filetosave = StrCat(SaveTo,fname)
oAttachItem.SaveAsFile(filetosave)
oAttachItem = 0
Next
oAttachments = 0
oMessage = 0
Next
oFolderItems = 0
oFolder = 0
oNameSpace = 0
MSapp = 0