Display Word Documents in Access97

  • Thread starter Thread starter Leonard Priestley
  • Start date Start date
L

Leonard Priestley

I have a form which refers to relevant Word documents. I want to store the
location of each document and open it via the Access Form.

When I tried using a hyperlink, I found that when the Word document opens,
the Access form is minimised, and the process of closing the Word document
and maximising Access is do-able, but feels clumsy and inconvenient.

I tried a command button with the following code:

Dim oApp = CreateObject("Word.Application")
oApp.Visible = True

- and this would be just fine, because it opens the Word document in a
smaller window, leaving the original Access form visible, so the user knows
where they are and how to get back to Access. My problem is, I can't find
the code to specify the name of the document I want opened. Is there a web
site that has information on this subject?

Ideally, I would also like some code in Access that ensures the Word
document is closed, not just minimised when the user is finished with it.

Regards
Leonard Priestley
 
This information could be incorrect (It works in 2000 and 2002). I use a
bound OLE object frame and link the word document using this. It then
displays the document as well in Access.(You could use an Icon also if
screen space is a factor). By double clicking on this Word opens and when
closed Access is still in the same state you left it.
set the link and display properties to suit your needs.
THT
 
Leonard,

Try

Dim oApp As New Word.Application
oApp.Documents.Open (strFilename)
oApp.Visible = True

although all you need to do is add the middle line to the code you have.

Rod Scoullar
 
Thank you very much, Earthlink, and Rod Scoullar. Your help is much
appreciated. I think Rod's suggestion is most in line with what I was
after, but the suggestion of a bound OLE object frame is probably going to
get used also.

Leonard Priestley
 
Back
Top