Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I open an Office document using VBScript? 1

Status
Not open for further replies.

troyu

Programmer
Nov 21, 2000
185
CA
My question is simple:
How do I open an already saved Office document (not a new document) using VBscript in an Outlook form? I would like to use a Command Button to do so, and open the Office document.

Please let me know.

Thanks,
Troy troy_underwood@owfg.com
 
I think I got it:

Sub CommandButton1_Click()
Set Word = CreateObject("Word.Application")
Word.Visible = TRUE
Word.Documents.Open("C:\My Documents\Myfile.doc")
End Sub

This is how to open a web site with a command button:
Sub CommandButton2_Click()
Set Web = CreateObject
"InternetExplorer.Application")
Web.Visible = TRUE
Web.Navigate "End Sub troy_underwood@owfg.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top