Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2006

Tip: Looking for answers? Try searching our database.

Command button and macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CaveDrake - 15 Nov 2006 09:45 GMT
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
CaveDrake - 15 Nov 2006 09:51 GMT
I should have mentioned, it is Word 2003
Greg Maxey - 15 Nov 2006 13:29 GMT
Cave,

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

Private Sub CommandButton1_Click()
With Dialogs(wdDialogFileSaveAs)
 .Show
 .Execute
End With
End Sub

> 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
[quoted text clipped - 8 lines]
>
> Cave
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.