Discussion:
Sending Word-File from VBA as attachement?
(too old to reply)
Michael Vogt
2005-09-30 07:20:29 UTC
Permalink
Hi out there,

I am loooking for a way to realize the following:

a word-textdokument 8Word-2k..xp) with a VBA-button inside.
If the button is pressed, the file shell be send by E-mail as attached file
to a defined Mail-adress
Perhaps even with a default header and body.

What I need is an idear of how to do it.
Recording a macro fails while I am leaving word to type the mail-adress in
outlook.
So how to pass the adress & word-file to Outlook for posting?

Any hints welcome.

Regards


Michael
Sue Mosher [MVP-Outlook]
2005-10-02 16:01:06 UTC
Permalink
This Word VBA code saves and attaches the current document to a new Outlook email message, addresses the message, then displays it:

Sub SendMe()
If Not ActiveDocument.Saved Then
ActiveDocument.Save
End If
Set ol = CreateObject("Outlook.Application")
Set msg = ol.CreateItem(0)
msg.To = "***@somedomain.com"
msg.Subject = ActiveDocument.Name
msg.Display
' next statement will trigger security prompt
'msg.Send
Set msg = Nothing
Set ol = Nothing
End Sub
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
Post by Michael Vogt
Hi out there,
a word-textdokument 8Word-2k..xp) with a VBA-button inside.
If the button is pressed, the file shell be send by E-mail as attached file
to a defined Mail-adress
Perhaps even with a default header and body.
What I need is an idear of how to do it.
Recording a macro fails while I am leaving word to type the mail-adress in
outlook.
So how to pass the adress & word-file to Outlook for posting?
Any hints welcome.
Regards
Michael
alevansal
2005-11-10 19:14:43 UTC
Permalink
See if this site helps:

http://word.mvps.org/FAQs/InterDev/SendMail.htm
Post by Michael Vogt
Hi out there,
a word-textdokument 8Word-2k..xp) with a VBA-button inside.
If the button is pressed, the file shell be send by E-mail as attached file
to a defined Mail-adress
Perhaps even with a default header and body.
What I need is an idear of how to do it.
Recording a macro fails while I am leaving word to type the mail-adress in
outlook.
So how to pass the adress & word-file to Outlook for posting?
Any hints welcome.
Regards
Michael
Loading...