Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WORD-Electronic mail as an attachment

Status
Not open for further replies.
Jun 30, 2003
196
0
0
GB
I have a mail merge system set up and i want to mail my document as an attachment. is there away i can set it up so that the document is mailed as an attachment (i know how to do this part) but the email has a short message displayed on it aswell, is this possible
 
Hi

Office 2000/XP

File -> Send To -> Mail Recipient(As Attachment) ??
 
yeah but its a mail merge from a database query. So when i set up the merge in word and send it as an attachemnt i dont get the option to write an email. it just sends the emails out as an attachment on a blank email.
 
im not sure i made my self clear.... For instance it is a mail merge so i could be sending the same message to hundreds of people, so doing it the way u sugggested would require to do each email one by one.

 
I came across this post because I'm searching for an answer to this as well.

I can send an attachment with a subject line but like you, nothing appears in the message body.

Why would Microsoft not want us to be able to do this. We have an email questionnaire but it looks pretty dubious when it is sent out with a blank message.

I've tried adding a signature or a stationary template but the email merge just ignores them all and sends them out blank.

I'll post if I can find any answers, or even any other software that will do the job.
 
yeah cheers that would be great ill do that aswell if i stumble across the answer!
 
There is a lump of code on this site that does this, I will go and try to find it

Neil Berryman
IT Trainer
neil_berryman@btopenworld.com
 
Here it is

You can't with SendObject.
If you use Outlook (not Outlook Express), then it can be done like below:

Sub SendAttachedFile(FileNameAndPath$, AttachDescr$, ToAdds$, CCAdds$, BCCAdds$, SubjectLine$, MsgBody$)

Dim myOlApp, MyItem, MyAttachments
Set myOlApp = CreateObject("Outlook.Application")
Set myItem=myOlApp.CreateItem(olMailItem)

With myItem
.To = ToAdds
.CC = CCAdds
.BCC = BCCAdds
.Subject = SubjectLine
.Body = MsgBody
.Attachments.Add FileNameAndPath, olByValue, 1, AttachDescr
.Display 'this will display the result
.Send 'this will place the message immediately to Outbox
End With

set myItem = Nothing
MyOlApp.Close
Set myOlApp = Nothing
End Sub

All procedure arguments should be provided by text boxes on your form.
The procedure can be called from a command button:

Private YourButton_Click()
'whatever code you want to execute before sending the mail
Call SendAttachedFile(Me("FileTextBox"), Me("FileDescription"), Me("ToAddresses"), Me("CCAddresses"), Me("BCCAddresses"), Me("Subject"), Me("Body"))
End Sub

HTH


Daniel Vlas
Systems Consultant
danvlas@yahoo.com


Neil Berryman
IT Trainer
neil_berryman@btopenworld.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top