Send open doc as attachment to a specific recipeint

J

JoAnn

Hi,

I'm trying to create a macro in Word 2003 that will let me send the active
document as an attachment to a particular person or distribution address
(they will always be the same).

When I tried using SendMail, I get an empty email with the doc as an
attachment ... but ... I have to manually enter the Recipients. The
recipients are not even captured if I record my macro actions to create the
macro.

Is there anyway to create a macro with the recipients already provided? I
could create the email as an email template/form but still don't know how to
pass that on to Word.

Since the users wouldn't have that email form on their PC anyway, having the
recipients already provided in the macro code seems like the only way to do
this.

Thanks for your help,
 
J

JoAnn

Thanks Jay! That works great for sending the document automatically to the
desired recipient.

Do you know if there is anyway to get it to display the message before
sending so the user can add information to the body of the message before
sending it?
 
D

Doug Robbins - Word MVP

The addition of the line

.Body = InputBox("Enter the text of the message here", "Send
Attachment")


in this section of the macro will display an input box into which the user
could insert a short message:

With oItem
.To = "(e-mail address removed)"
.Subject = "New subject"
.Body = InputBox("Enter the text of the message here", "Send
Attachment")
'Add the document as an attachment, you can use the .displayname
property
'to set the description that's used in the message
.Attachments.Add source:=ActiveDocument.FullName, Type:=olByValue, _
DisplayName:="Document as attachment"
.Send
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
J

Jay Freedman

I think the answer is "probably". I've never played with this to see exactly
what it does.

If it can be done, it will involve adding some code just before the line

.Send

but I'm not sure what that code would be. Maybe someone else will chime in
here, or you can ask on the Outlook programming newsgroup
(http://www.microsoft.com/communitie....aspx?dg=microsoft.public.outlook.program_vba).

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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