Command button and macro

C

CaveDrake

I'd like to have a command button in my MS Word 2003 document that is linked
to a macro. I would like this macro to save the file in a different
location.

Although this feels like it should be easy (as I have done the same in MS
Excel), I can't do it! I've inserted a command button from the control
toolbox but the code, when I view it starts with "private sub" instead of
"sub". It doesn't seem to let me select a macro. Can anyone help?

Many thanks,

Cave
 
G

Greg Maxey

Cave,

Just put your code in the Private Sub e.g.,


Private Sub CommandButton1_Click()
With Dialogs(wdDialogFileSaveAs)
.Show
.Execute
End With
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