|
|
|
|
|
|
Word
|
Display email item with content of document or attach it.
|
|
Ease of Use
|
Easy
|
Version tested with
|
2000, 2003
|
Submitted by:
|
MOS MASTER
|
Description:
|
Programmatically Display Email item with the content of the active document in the body or active document as attachment.
|
Discussion:
|
A quick way to set up an Email item with the content or the active document as attachment. The value add is that there is still room to make adjustments to the email item before you send it.
|
Code:
|
instructions for use
|
Option Explicit
Sub DisplayContentInEmail()
With Application
.Options.SendMailAttach = False
.ActiveDocument.SendMail
End With
End Sub
Sub DisplayAttachDocumentInEmail()
With Application
.Options.SendMailAttach = True
.ActiveDocument.SendMail
End With
End Sub
|
How to use:
|
- Open your Word document.
- Press Alt + F11 to open VBE.
- Insert-Module. (Insert -> module)
- Paste the code there in the window at right. (F7)
- Close VBE (Alt + Q or press the X in the top right hand corner).
- Save the file.
|
Test the code:
|
- From Word, press Alt + F8 to open the macro dialog box.
- Select DisplayContentInEmail for the document content in the email item.
- Select DisplayAttachDocumentInEmail to attach the activedocument to the email item.
- Click Run.
|
Sample File:
|
Display email item.zip 5.68KB
|
Approved by mdmackillop
|
This entry has been viewed 99 times.
|
|