General information
Category:
COM/DCOM and OLE Automation
Environment versions
Network:
Windows 2003 Server
I am having an intermittent problem with "myItem.Delete()" below. Sometimes it works great and sometimes I get an OLE error "Parameter not optional". Same computer each time. Have any idea what would cause this?
myOlApp = CREATEOBJECT("Outlook.Application")
nms = myOlApp.GetNamespace("MAPI")
myFolder = nms.GetDefaultFolder(10)
lcFolderName = "text weather"
llFolderExists = .F.
FOR EACH loFolder IN myFolder.Folders
IF loFolder.NAME = lcFolderName
llFolderExists = .T.
lcTWfolder = loFolder
EXIT
ENDIF
ENDFOR
IF NOT llFolderExists
lcTWfolder = myFolder.Folders.ADD("text weather")
ENDIF
fldContacts = lcTWfolder.Items
myItems = fldContacts.RESTRICT("[CompanyName] = 'Texting'")
FOR i=myItems.COUNT TO 1 STEP -1
myItem = myItems.ITEM(i)
IF (myItem.CLASS = 40)
myItem.Delete()
ENDIF
ENDFOR
Previous
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