Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > Add Word doc as attachment
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 9th April 13:53
sue mosher [mvp]
External User
 
Posts: 1
Default Add Word doc as attachment



Just add the code to save the do***ent (Do***ent.Save), then attach it (MailItem.Attachments.Add)
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.slipstick.com/books/jumpstart.htm
  Reply With Quote


  sponsored links


2 16th April 13:13
arlene swedberg
External User
 
Posts: 1
Default Add Word doc as attachment



then attach it (MailItem.Attachments.Add)


unable to. Could you point me to some examples?

Thank you,

Arlene
  Reply With Quote
3 16th April 13:13
sue mosher [mvp]
External User
 
Posts: 1
Default Add Word doc as attachment


There's not much to saving and attaching. Assume objDoc is your Word doc. Use whatever you prefer for the path:

strPath = "C:\mydoc.doc"
objDoc.SaveAs strPath
Set objMail = Application.CreateItem(0)
objMail.Attachments.Add strPath
objMail.Display

See http://www.slipstick.com/dev/code/copyatts.htm for a code sample that shows how to use the Temp folder for saving the attachment and then delete it afterwards.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.slipstick.com/books/jumpstart.htm
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666