Creating a button to send doc as email to fixed addy

E

Ernest Lai

Good afternoon all,

I still searching google and the MS word help files but so far no joy. I am
looking to create a button within my word document. This button, on push
will automatically send the entire doc as an email attachment to a fixed
email address.

Any help is much appreciated, Thanks in advance!

Ernest
 
E

Ernest Lai

OK i think i may have found it thanks to the MVP site :)

going to use:

{ MACROBUTTON MyMacroName Double-Click To Run Macro }

to run a macro and the macro will hopefully email it off to a fixed addy.
ill post my results.
 
C

clburrill

Did you find a response to this question? I need assistance with the same
thing. Can you assist me?
 
J

jerem

Good question and good answer, however, how do you get the macrobutton to
appear in the document but not print out when you print the document. I want
a button that appears in the document but is invisible to the printer (and I
don't want to have to put a button on a toolbar).
 
R

Russ

Jerem,
The trick is usually to format as hidden and make sure that the print hidden
option is off. In PrintPreview mode you shouldn't see it, if hidden.

See the section "Modifying the MacroButton Code"
 
R

Russ

Jerem,
You can display or hide hidden objects to the user, but if the print option
is set correctly, it won't print even though the user sees it in normal
mode, although the user won't see it in PrintPreview.


For hidden font text you can toggle
The Main Toolbar Show/Hide Button (¶)

Or use VBA code:
ActiveWindow.ActivePane.View.ShowAll = Not ActiveWindow.ActivePane.View. _
ShowAll
or
ActiveWindow.ActivePane.View.ShowAll = True 'or False
 
R

Russ

Jerem,
It is polite to store the all the user's settings or options that you are
going to mess with and restore them at the end of your macro.
For example:

Dim theShowAll as Boolean

theShowAll = ActiveWindow.ActivePane.View.ShowAll
....
ActiveWindow.ActivePane.View.ShowAll = True' or False
....
ActiveWindow.ActivePane.View.ShowAll = theShowAll
 
E

Ernest Lai

Hi all,

Sorry didnt have access to my work files while away. This is the macro code
below: I then used 'Toggle Field Codes' To turn a line of text into a on
click button to run the macro 'send_email'. This isnt the full process but
at least you know what to look for on the MVP website. Sorry for the half
info :) best of luck.

Ernest



Sub send_email()
'
' send_email Macro
' Macro created 28/06/2007 by XXX
'


ActiveDocument.HasRoutingSlip = True
With ActiveDocument.RoutingSlip
.Subject = "Test Email button"
.AddRecipient "(e-mail address removed)"
.AddRecipient "(e-mail address removed)"
.AddRecipient "(e-mail address removed)"
.Delivery = wdAllAtOnce
End With
ActiveDocument.Route

End Sub
 

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