If you want Word to run independently of your Access app, use a Shell function:
Shell "C:\Program Files\Microsoft Office\Office\winword.exe ""C:\My Documents\report.doc""", vbNormalFocus
If you want to control Word from Access, you'll need Office 2000 Developer Edition. Add a reference to the Office 9.0 typelib, then use code like the following:
Dim appWord As Word.Application
Set appWord = New Word.Application
From there you just use methods of appWord to open the file and manipulate it.
You can probably do this with Word 97, too, but I believe you'd need an entirely different approach. Rick Sprague
The Sendkeys Command may be something to look into, you can send keystrokes to the actice application you are on. I have used it in a macro in combination with runapp. All you have to do is put in the command line of Word (c:\program files\microsoft office\office\winword.exe), then on the next line use your sendkeys command. You will need a ref for the non character keys (Alt, Tab, Esc) I have one if you need it. Good luck.
Set FaxDoc = CreateObject("Word.Application"
Set SendFax = FaxDoc.Documents.Add(Template:="PathOfFaxTemplate.dot"
FaxDoc.Visible = True
then if you are going to fill in parts of the template then:
Set Marker = SendFax.Goto(what:=wdGoToBookmark, Name:="TargetName"
Marker.InsertBefore ContactSet.Fields("FirstName".Value & " " & ContactSet.Fields("Surname".Value
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.