"send email" button in MS word

Hi guys!
Is there anybody here who knows how to add a button in a Microsoft Word document Then when I click the button it sends an email with the document as attachment.

Thanks.



Answer this question

"send email" button in MS word

  • CarlosAcosta

    Copied from the object model help for the sendmail() method:

    Opens a message window for sending the specified document through Microsoft Exchange.

    Note Use the SendMailAttach property to control whether the document is sent as text in the message window or as an attachment.

    expression.SendMail

    expression Required. An expression that returns a Document object.

    Example

    This example sends the active document as an attachment to a mail message.

    Options.SendMailAttach = True
    ActiveDocument.SendMail
    


  • Mike New

    In the object model HELP files, look up the MailEnvelope object, with related topics. Note that this is an extension of *Outlook*. Any further questions on this topic you should pursue in an Outlook or Word programming group (or possibly a combination of the two).



  • tfif

    Looks interesting! will give it a try and let you know.

    Regards
    Pavan


  • codesergeant

    I've got it working this way using the .sendmail() method but can anyone tell me how to get the email system built into word 2003 working so that it sends the document as the email and not an attachment

    like>

    http://www.boomspeed.com/dead_smed/doc10.jpeg


    Many thanks for any help


  • HarryG

    that does use the document as the body instead of an attachment but looses the formatting and doesn't use the email options that are built into Word, is it possible to use it like in the screenshot supplied


  • biap

    Is there a way to also set the MailTo: property, and subject using this method.

    I am able to attach word doc but can't get it to address the email for me.

    I don't want to have to use the mailmerge property as there is no datasource.

    The document I am trying to email is a form template in word sent to same address everytime.



  • Juniorscone

    this.ActiveWindow.EnvelopeVisible = true;

    seems to have cracked it, many thanks!


  • Joe_MS

    VSTO 2005 only supports Office 2003. If you have the Beta of Office 2007, you can use the CTP of VSTO. For more information see, http://blogs.msdn.com/eric_carter/archive/2006/03/21/556796.aspx

  • PrimeTime

    This is actually very cool Kathleen! I mean if i had to do this without using VSTO appraoch i had to take care of a zillion things.

    But i wonder why VSTO doesnt support Office 2k,XP and 12. Are there any plans for the same


  • Richard Lyon

    Hi,

    You can add a Windows Forms Button to a document using VSTO by dragging it from the toolbox to the document. For more information, see http://msdn2.microsoft.com/en-us/library/b86d6w07(VS.80).aspx. Then you can use the SendMail method of the document.

    Kathleen McGrath

     



  • "send email" button in MS word