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

Opening a Word Doc Using A Form and command Button

Status
Not open for further replies.

omega1983

Programmer
Dec 21, 2004
32
US
Using Access, I want to open a word doc located on a particular drive (ie I drive). Lets say the report name is adhoc and it is inside a folder called memo. The path would be I:/memo/adhoc. In my access form using a command button and inside the properties, I want to use an event and say onclick docmd.open the word doc. Any ideas on the simplest approach to take?
 
Hi
This is probably the easiest:
[tt]strLink = "I:\Memo\adHoc\SomeDoc.Doc"
FollowHyperlink strLink[/tt]
 
Hey Omega,

Try:

Dim stAppName As String
Dim stPathA As String
Dim stPathB As String
Dim stCombinedPath As String

stPathA = SysCmd(acSysCmdAccessDir)
stAppName = "WINWORD.EXE "
stPathB = "PathToYourWordFile.doc"
stCombinedPath = stPathA & stAppName & stPathB
Call Shell(stCombinedPath, 1)


 
ssatech
Are you able to take this one step further?

I would like to then allow the Word template to referance some of the fields contained within the current record of my Access form.

Would this be automatic if I set bookmarks in the Word template to = the field names on the form?

If IT ain’t working Binnit and Reboot
 
Now you are talking about automating an instance of Word through a declared Object.
 

Can you throw a bit more light on this for me rubbernilly?

Ta

If IT ain’t working Binnit and Reboot
 
I have just found faq705-3237 so will look at this a bit closer first.


If IT ain’t working Binnit and Reboot
 
You could try:
Opening a Word Document and filling it with data from an Access Form
faq702-2379
 
Yeah, sorry, binnit... I got rushed there. The code you found and the code Remou posted was the sort of thing I was suggesting.
 
Both these FAQ's look very much like what I need, thanks to both for pointing me in the general direction...

If IT ain’t working Binnit and Reboot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top