![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi,
I'm hoping someone can help me understand what is going on with the following senario I have AccessXP with Outlook2007 and this vba code on a form in Access which sends an email, with Outlook 'closed' this code works as long as I attach a file. If I comment out the .Attachedment Add line with Outlook closed the code fails on the .Send line with error - 287 - Application-defined or Object-defined Error But, with Outlook open this code works with or without the .Attachment Add line. I don't get it, why do I have to have an attachment in order to get this code to work with Outlook closed??? bobh. Dim objOutlook As Object, objMail As Object Set objOutlook = CreateObject("Outlook.Application") Set objMail = objOutlook.CreateItem(0) With objMail .To = TheTo .Subject = TheSubj .body = TheBody .Attachments.Add "c:\empty.txt" .Importance = olImportanceHigh .ReadReceiptRequested = True .Send End With 'clean up Set objMail = Nothing Set objOutlook = Nothing |
Ads |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I get email in Outlook Express on an XP machine into Outlook2007 on Windows 7 Machine? | MikeH[_2_] | Outlook - General Queries | 8 | November 21st 09 11:35 PM |
Outlook2007 | Rick | Outlook - Installation | 4 | March 16th 09 11:48 AM |
TO and CC email addresses hidden when forwarding an email [Outlook2007] | Chris Wood | Outlook - General Queries | 3 | January 6th 09 06:56 PM |
outlook2007 contact not displayed when writing email | Cliff | Outlook - General Queries | 1 | July 4th 07 11:26 PM |
Outlook2007 - email on server | 4Callanans | Outlook - General Queries | 3 | February 10th 07 10:50 PM |