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

Open a Word document from Access 1

Status
Not open for further replies.

NWTrust

Technical User
Apr 2, 2002
68
GB
Hi
I'm hoping to be able to open, edit and print a Word document from an Access form. I believe this is possible but can find no instructions for doing it. I'm running Access 2003.
Any help would be much appreciated.
Regards
John
 
Did you check the FAQ's? Did you do a search on "word document"? Did you google? Did you look in an Access book? I found these:
faq702-2379
thread702-1502670
 
Hi,
Try this code:

Dim strfilename As String
Dim wrd As Object
Dim wrd1 As Object
strfilename = "path to file"
Set wrd1 = CreateObject("word.application.9")
Set wrd = GetObject(, "Word.Application.9")
wrd.Visible = True
wrd.Documents.Open strfilename, , True
wrd.Activate

or you can open an existing notepad file with this;

Shell ("C:\WINDOWS\NOTEPAD.EXE C:\My Documents\FolderName\FileName.txt")

A fool and his money are soon parted - so you might as well send it to me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top