hi,
I have recently changed my PC to windows 10 with outlook 2010. I have this code which worked fine on Windows 7-64 bit with outlook 2003.
oOutLookObject = CREATEOBJECT("Outlook.Application")
olNameSpace = oOutLookObject.GetNameSpace("MAPI")
olFolder="G Suite - myname.myname@domain.ca"
myFolder="Inbox"
objFolder1=olNameSpace.Folders(olFolder)
objFolder=objFolder1.Folders(myFolder)
myAtts=objFolder.Items
FOR EACH loItem IN myAtts
IF loItem.attachments.COUNT >0 && Make sure there is an actual attachment.
FOR i = 1 TO loItem.attachments.COUNT
lcFilename=""
lcFilename = loItem.attachments.ITEM(i).filename
lcFilename = ALLTRIM(lcPath)+lcFilename
loItem.attachments.ITEM(i).SaveAsFile(lcFilename)
NEXT
ENDIF
NEXT
which crashes now.
It opens a "Welcome to Outlook 2016" window (which I have no idea why because I use outlook 2010). and then it crashes with "Ole disptach excpetion code 4096"
can anybody please help.
Thank you,
FOXUP!
I have recently changed my PC to windows 10 with outlook 2010. I have this code which worked fine on Windows 7-64 bit with outlook 2003.
oOutLookObject = CREATEOBJECT("Outlook.Application")
olNameSpace = oOutLookObject.GetNameSpace("MAPI")
olFolder="G Suite - myname.myname@domain.ca"
myFolder="Inbox"
objFolder1=olNameSpace.Folders(olFolder)
objFolder=objFolder1.Folders(myFolder)
myAtts=objFolder.Items
FOR EACH loItem IN myAtts
IF loItem.attachments.COUNT >0 && Make sure there is an actual attachment.
FOR i = 1 TO loItem.attachments.COUNT
lcFilename=""
lcFilename = loItem.attachments.ITEM(i).filename
lcFilename = ALLTRIM(lcPath)+lcFilename
loItem.attachments.ITEM(i).SaveAsFile(lcFilename)
NEXT
ENDIF
NEXT
which crashes now.
It opens a "Welcome to Outlook 2016" window (which I have no idea why because I use outlook 2010). and then it crashes with "Ole disptach excpetion code 4096"
can anybody please help.
Thank you,
FOXUP!