A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

MailItem Attachments Inconsistency



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old August 14th 06, 03:11 PM posted to microsoft.public.outlook.program_vba
Geoff
external usenet poster
 
Posts: 21
Default MailItem Attachments Inconsistency

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


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help - can't add "Item" (of type MailItem) using Attachments.Add() [email protected] Outlook and VBA 1 August 3rd 06 06:55 AM
OL2003: Open Mailitem René Panzeri Outlook and VBA 3 July 9th 06 09:49 PM
MailItem Folder Path Fox via OfficeKB.com Outlook and VBA 1 July 7th 06 03:39 PM
Read body of MailItem ? Trey Shaffer Outlook and VBA 1 March 18th 06 08:56 PM
How can I create a MailItem that displays like a received MailItem ? Clive Outlook - Using Forms 0 February 27th 06 05:14 PM


All times are GMT +1. The time now is 08:53 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.