General information
Title:
C0000..5 error when using Outlook automation
Hi all,
Finally got my download of VFP7. The first thing I did was recompile an existing VFP6 app that has been in production use for a couple of years. I have a synchronization routine with outlook that never had a problem in 6, but crashes with the fatal C0000005 (whatever) error on the last line of code below.
** Get reference to outlook
oOutlook = LaunchOutlook() && uses GetObj
loSpace = oOutlook.GetNameSpace("MAPI")
loSelFolder = .NULL.
FOR EACH loFolder IN loSpace.Folders
IF ALLT(loFolder.name) == m.OLSyncFolder
loSelfolder = loFolder
EXIT
ENDIF
FOR EACH loSubFolder IN loFolder.Folders
IF ALLT(loSubfolder.name) == m.OLSyncFolder
loSelfolder = loSubFolder
EXIT
ENDIF
FOR EACH loSubX IN loSubFolder.Folders
IF ALLT(loSubX.name) == m.OLSyncFolder
loSelfolder = loSubX
EXIT
ENDIF
ENDFOR
ENDFOR
IF !ISNULL(loSelFolder)
EXIT
ENDIF
ENDFOR
IF ISNULL(loSelFolder)
=MESSAGEBOX("Folder '" + m.OlSyncfolder + "' is invalid or not found.",48,"System Message")
RETURN
ENDIF
** UPDATE
*- Reference the selected folder
*- Contact Items
IF Type("loSelfolder")<>"O"
=MESSAGEBOX("Invalid folder selected",48, "Sync Error!" )
RETURN
ENDIF
loContacts = loSelfolder.Items
----------------------------------
The loSelfolder object is an object at this point in the code.
Has anything changed in the COM interface that might cause this.
Thanks all,
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only