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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open winword.exe in Access vba

Status
Not open for further replies.

Roofus

Programmer
Jun 11, 2002
2
BE
I'm looking for a way to open Microsoft Word when i click on a button in a form i've made. if you can't open word directly, can i open a .doc file then?
thank you in advance.
Rufus
justaz@flashmail.com
 
You can start Word several ways. First, add the MS Word Object Library to your Project>References.
Then, using early binding:
Code:
Dim wdApp As Word.Application
Set wdApp = New Word.Application
or, using late binding
Code:
Dim wdApp As Object
Set wdApp = CreateObject("Word.Application")
You can also open a .doc file directly if you don't need to manipulate the document with code. Check for samples of the ShellExecute method in these forums. That will open a file with it's registered application, similar to double-clicking the file from Explorer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top