JonJParr
15-04-2005, 09:18
I would like to write a macro to attach to a button in Microsoft Word that when clicked emails a copy of the document (which will be a completed form) to a specific email address. Is this possible and if so, can someone advise me how to do it?
Thanks in advance.
Not sure if emailing direct from word is possible without doing something specific like connecting to a specific outgoing mail server. Even then it might not work as it could be used to create virus's. i.e. replace the onClick of the button for onLoad and you've got the basics of a virus.
Wouldn’t a web form be more appropriate?
Yes, mailing from Word directly is possible.
I use it quite frequently when writing simple document management systems for customers.
Yoiu can use either the 'routing slip' method or automate Outlook with VBA.
Take a peek at :
http://word.mvps.org/FAQs/InterDev/SendMail.htm
Hope this helps.
Joe
JonJParr
15-04-2005, 09:52
Thanks Joe - it's worked.
Cheers! :thumbsup:
JonJParr
15-04-2005, 10:16
Sorry another problem Joe, how do I now attach that macro to a command button??
Thanks again.
Hiya,
In View, Toolbars, enable the Visual Basic Toolbar and then select the Toolbox Control - the thing that looks like a hammer and screwdriver crossed.
Select the Control Button from there and place it on your document.
Double click on the button and put the code in there.
Save the code, close the VB Toolbar, and that should be that!
Joe