![]() |
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
|
|||
|
|||
![]()
Hello,
Any suggestions on why I get a "Run Time Error '-1407020020 (a838838833)': Can't find this file. Make sure the path and file name are correct." in the code below? Public Sub Application_Startup() ' Reference the items in the Inbox. Because myOlItems is declared ' "WithEvents" the ItemAdd event will fire below. Set myOlItems = Outlook.Session.GetDefaultFolder(olFolderInbox).It ems End Sub Private Sub myOlItems_ItemAdd(ByVal Item As Object) ' Check to make sure it is an Outlook mail message, otherwise ' subsequent code will probably fail depending on what type ' of item it is. If TypeName(Item) = "MailItem" Then Dim mailToFwd As MailItem Set mailToFwd = Item 'create a new message and address it Dim myEmail As MailItem Set myEmail = Application.CreateItem(olMailItem) myEmail.To = " myEmail.Subject = "FYI" ' attaching the file myEmail.Attachments.Add (Item) ' now send the message myEmail.Send End If End Sub |
#2
|
|||
|
|||
![]()
Am 2 Aug 2006 08:37:58 -0700 schrieb :
If you do not need the function result, i.e. the ref onto the added attachment, then donīt write the brackets, but: myEmail.Attachments.Add Item -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- Hello, Any suggestions on why I get a "Run Time Error '-1407020020 (a838838833)': Can't find this file. Make sure the path and file name are correct." in the code below? Public Sub Application_Startup() ' Reference the items in the Inbox. Because myOlItems is declared ' "WithEvents" the ItemAdd event will fire below. Set myOlItems = Outlook.Session.GetDefaultFolder(olFolderInbox).It ems End Sub Private Sub myOlItems_ItemAdd(ByVal Item As Object) ' Check to make sure it is an Outlook mail message, otherwise ' subsequent code will probably fail depending on what type ' of item it is. If TypeName(Item) = "MailItem" Then Dim mailToFwd As MailItem Set mailToFwd = Item 'create a new message and address it Dim myEmail As MailItem Set myEmail = Application.CreateItem(olMailItem) myEmail.To = " myEmail.Subject = "FYI" ' attaching the file myEmail.Attachments.Add (Item) ' now send the message myEmail.Send End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I add or delete an addressee in the "To" and "CC" boxes? | bkaras | Outlook - Installation | 1 | July 30th 06 04:51 AM |
How do I add or delete an addressee in the "To" and "CC" boxes? | bkaras | Outlook - Installation | 0 | July 29th 06 07:51 PM |
I do not have "Encoding" item in my "View" menu of Outlook 2003? | Baher | Outlook - Installation | 0 | June 20th 06 10:35 AM |
How to add new "addresses" deafaults e.g. "Mr. and Mrs." | H. Christinger | Outlook - Using Contacts | 1 | May 26th 06 10:35 AM |
How do I change or add an "Entry Types" in journal entrys | MGS | Outlook - General Queries | 2 | January 22nd 06 01:14 AM |