G
Geoff
Outlook 2002:
Attachments to a Mailitem object are not attached when the code runs at
normal speed, but are attached if I place a Break on the Display line (last
line in code snippet below) and press F8 to execute the Display statement in
step mode. Although the MailItem is saved before attaching the attachments,
I'm still getting this inconsistent result. It seems like a timing issue,
but DoEvents doesn't help. Any clues please?
Very many thanks.
Regards
Geoff
Dim objMI as Outlook.MailItem
Dim objATTACHMENTS as Outlook.Attachments
Set objMI = mobjOL.CreateItem(olMailItem)
.... some objMI properties set here, like "To"...
objMI.Save
Set objATTACHMENTS = objMI.Attachments
objATTACHMENTS.Add "PathNameToFile", olByValue
objMI.Display
Attachments to a Mailitem object are not attached when the code runs at
normal speed, but are attached if I place a Break on the Display line (last
line in code snippet below) and press F8 to execute the Display statement in
step mode. Although the MailItem is saved before attaching the attachments,
I'm still getting this inconsistent result. It seems like a timing issue,
but DoEvents doesn't help. Any clues please?
Very many thanks.
Regards
Geoff
Dim objMI as Outlook.MailItem
Dim objATTACHMENTS as Outlook.Attachments
Set objMI = mobjOL.CreateItem(olMailItem)
.... some objMI properties set here, like "To"...
objMI.Save
Set objATTACHMENTS = objMI.Attachments
objATTACHMENTS.Add "PathNameToFile", olByValue
objMI.Display