Controlling Outlook from a Word Macro?

D

david_alex_smith

Hello,

My problem is this:

I want to have a macro that prints a doc to PDF (i can do this bit), then
opens up an outlook mail message with the generated PDF already listed as an
attachment.

Can anyone tell me if it's possible to do this, and if so, how?

Thanks.
 
H

Helmut Weber

Hi David,

like this:

Sub OutlookX()
' reference to outlook set
' = early binding

Set MyOutlook = CreateObject("Outlook.Application")
Set mymail = MyOutlook.CreateItem(olMailItem)

mymail.Subject = "Fac simile"
mymail.To = "(e-mail address removed) "
mymail.Body = "" ' not necessary
mymail.attachments.Add "c:\test\test.doc" ' or your PDF
mymail.Display ' or send of course !
'mymail.send

Set MyOutlook = Nothing '!
Set mymail = Nothing '!

End Sub


--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top