Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2007

Tip: Looking for answers? Try searching our database.

Send open doc as attachment to a specific recipeint

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JoAnn - 03 Apr 2007 19:04 GMT
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,
Signature

JoAnn

Jay Freedman - 03 Apr 2007 19:47 GMT
See if the last macro in http://www.word.mvps.org/FAQs/InterDev/SendMail.htm 
helps.

Signature

Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

> Hi,
>
[quoted text clipped - 16 lines]
>
> Thanks for your help,
JoAnn - 03 Apr 2007 20:52 GMT
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?

Signature

JoAnn

> See if the last macro in http://www.word.mvps.org/FAQs/InterDev/SendMail.htm 
> helps.
[quoted text clipped - 19 lines]
> >
> > Thanks for your help,
Doug Robbins - Word MVP - 03 Apr 2007 21:53 GMT
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 = "recipient@mail.com"
   .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

Signature

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

> Thanks Jay!  That works great for sending the document automatically to
> the
[quoted text clipped - 28 lines]
>> >
>> > Thanks for your help,
JoAnn - 04 Apr 2007 20:28 GMT
Thanks, Doug ... the input box was just what I needed!
JoAnn

> The addition of the line
>
[quoted text clipped - 49 lines]
> >> >
> >> > Thanks for your help,
Jay Freedman - 03 Apr 2007 21:54 GMT
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/communities/newsgroups/en-us/default.aspx?dg=microsoft.
public.outlook.program_vba
).

Signature

Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

> Thanks Jay!  That works great for sending the document automatically
> to the desired recipient.
[quoted text clipped - 33 lines]
>>>
>>> Thanks for your help,
JoAnn - 04 Apr 2007 20:52 GMT
Thanks again, Jay ... Doug had the solution I needed.
Signature

JoAnn

> I think the answer is "probably". I've never played with this to see exactly
> what it does.
[quoted text clipped - 44 lines]
> >>>
> >>> Thanks for your help,
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.