choppysuey
Technical User
Hi all...need help in figuring out the code to delete messages in the sent items box of MS outlook. I got a VFP program that emails out an attachment at certain times of the day. Everytime it emails a message a copy is sent to the sent items box. Anybody have code that will access the sent items box and delete those messages after the message has been sent? Thx in advance.
Here is the code I pieced together to generate the automatic email:
OFORM = CREATEOBJECT('FORM')
OFORM.ADDOBJECT('MAPISESS','OLECONTROL','MSMAPI.MAPISESSION')
OFORM.ADDOBJECT('MAPIMESS','OLECONTROL','MSMAPI.MAPIMESSAGES')
OFORM.MAPISESS.USERNAME = '....'
OFORM.MAPISESS.PASSWORD = '****'
OFORM.mapisess.signon
OFORM.mapimess.sessionID = OFORM.mapisess.sessionID
OFORM.mapimess.compose
OFORM.mapimess.msgsubject = "TEST message"
OFORM.mapimess.msgNoteText = "message note"
OFORM.mapimess.AttachmentIndex = 0
OFORM.mapimess.AttachmentName = "tmwrfdata.DAT"
OFORM.mapimess.AttachmentPathName = "c:\scada\SCADA.DAT"
OFORM.mapimess.AttachmentPosition = 0
OFORM.mapimess.AttachmentType = 0
OFORM.mapimess.RecipIndex = 0
OFORM.mapimess.RecipDisplayName = "Mark, Bowman"
OFORM.mapimess.RecipAddress = "SMTP:SCADA@ci.sparks.nv.us"
OFORM.mapimess.RecipType = 1
OFORM.mapimess.send(0)
OFORM.mapisess.signoff
Here is the code I pieced together to generate the automatic email:
OFORM = CREATEOBJECT('FORM')
OFORM.ADDOBJECT('MAPISESS','OLECONTROL','MSMAPI.MAPISESSION')
OFORM.ADDOBJECT('MAPIMESS','OLECONTROL','MSMAPI.MAPIMESSAGES')
OFORM.MAPISESS.USERNAME = '....'
OFORM.MAPISESS.PASSWORD = '****'
OFORM.mapisess.signon
OFORM.mapimess.sessionID = OFORM.mapisess.sessionID
OFORM.mapimess.compose
OFORM.mapimess.msgsubject = "TEST message"
OFORM.mapimess.msgNoteText = "message note"
OFORM.mapimess.AttachmentIndex = 0
OFORM.mapimess.AttachmentName = "tmwrfdata.DAT"
OFORM.mapimess.AttachmentPathName = "c:\scada\SCADA.DAT"
OFORM.mapimess.AttachmentPosition = 0
OFORM.mapimess.AttachmentType = 0
OFORM.mapimess.RecipIndex = 0
OFORM.mapimess.RecipDisplayName = "Mark, Bowman"
OFORM.mapimess.RecipAddress = "SMTP:SCADA@ci.sparks.nv.us"
OFORM.mapimess.RecipType = 1
OFORM.mapimess.send(0)
OFORM.mapisess.signoff