Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jan 2002
    Location
    Texas
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Button to automatically create e-mail of document (Windows 2000)

    I would like assistance on creating a macro button to attach to a form that runs the command File-Send To-Mail Recipient (as attachment) when clicked.

    Basically, the objective is to have the employee fill out the form I have created, and then be able to click a macro button on the form that generates an e-mail from MS Outlook that all they have to do is put in my e-mail address and press Send, and I would get the form. (It would be even greater if there was a way to alter the macro so that the my e-mail address was already written in the "To" section of the e-mail.)

    I read the Help section on macro buttons and understand the syntax of the macrobutton form field ({ MACROBUTTON MacroName DisplayText }) However, do I need to create a new macro with the document that creates the e-mail, and put that as the second part of the field code? How exactly would I get the picture of the mail attachment button, and how would I attach it to the field code?

    Also, I want to attach this button to a password-protected locked form. Is this possible?

    Thank you for your assistance.

    -Cynthia Gill

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Button to automatically create e-mail of document (Windows 2000)

    Cynthia

    I wouldn't necessarily recommend using a MacroButton field to do this. It will work on a protected form but the user won't intuitively know to double click something on the page to send an email. It would be better to put a button on a floating toolbar to do the sending. The form should be saved as a template which will contains the macro you require to do the sending and the toolbar button as well.
    The macro (which won't automatically type your email address) would look like this
    <pre>Sub SendDocAsAttachment()
    Options.SendMailAttach = True
    ActiveDocument.SendMail
    End Sub</pre>

    If you need help to put the macro into a template and put a button the toolbar for that template - have a search through this archive or post back.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Button to automatically create e-mail of document (Windows 2000)

    Hi Andrew - thats a neat bit of code - thank you Diana

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •