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 / July 2005

Tip: Looking for answers? Try searching our database.

button in Word to open another document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
doug depker - 30 Jun 2005 15:03 GMT
I am trying to create a button in a document I have.  I want it to link to
another file on my hard drive.  I have not used VB in years and do not
remember the commands I need to type in.
Helmut Weber - 30 Jun 2005 15:36 GMT
Like this
Documents.open "c:\test\test.doc"

Greetings from Bavaria, Germany

Helmut Weber, MVP, WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
doug depker - 30 Jun 2005 15:45 GMT
What is the entire code?  I am trying to make a two buttons, one that says
Contacts and the other says Procedures.  What is the entire code from Sub
Test to End Sub?
Thanks
Helmut Weber - 30 Jun 2005 15:57 GMT
Hi,

View, toolbars, control toolbox.
Insert your commandbutton.
Right mouse click, viewcode:
Make the code look like this:

Private Sub CommandButton1_Click()
Documents.Open "c:\test\word\testlong.doc"
End Sub

Exit design mode.

>I am trying to make a two buttons,
>one that says Contacts and the other says Procedures.

?

Think we got a language problem here.

Greetings from Bavaria, Germany

Helmut Weber, MVP, WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
doug depker - 30 Jun 2005 16:00 GMT
Thank you that was what I was looking for.  How do I change the name of the
button?
doug depker - 30 Jun 2005 16:01 GMT
nevermind, found it
doug depker - 30 Jun 2005 16:57 GMT
How do I enable macros in Word.  I made the button in some of the other
documents, however in some of the word docs the button won't execute.  In VB
it says I need to enable macros in the host application.
Helmut Weber - 15 Jul 2005 14:46 GMT
Hi Doug,

start a new thread, or google.

There have been a lot of postings about macros,
that can't be executed because of security settings.

It's only that I can't test it.

Someone here will know, for sure.

Greetings from Bavaria, Germany

Helmut Weber, MVP, WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
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.