A Little Help on Opening Word Documents Please

iahclarke

New member
Local time
Today, 23:07
Joined
Jun 10, 2006
Messages
6
Hi all,

Sorry but I'm really new to Access and trying to make sense of all the useful advice on here!

I'm trying to programme a button in one of my forms to open up a word document as read-only. I've written the code to open up the Word application (before I found the button which did it for me! :( ) but I think I need to add one or two more lines so that word knows where the document is I want and opens it up - any ideas what these lines are?

Real sorry for the trouble - any help would be most appreciated! Thanks guys and girls.
 
Last edited:
I don't know what code you used to "Open Word" but if you create command button with the wizard to open word the the code will look like this (Plus the bit in blue that I have put in to "Open the Docuement")

Code:
Dim oApp As Object

    Set oApp = CreateObject("Word.Application")
    oApp.Visible = True
    [COLOR="Blue"]oApp.Documents.Open ("C:\Temp\OpenDoc.doc")
[/COLOR]

If you want to give the user a choice of documents to open (via combo or list box) then post back and I will post a sample db.
 
Thanks a lot for your help! That line you added was what I was missing - great! Is there anyway to set the document as read-only? Or open adobe pdf's instead? I assume you just change "word.application" to "adobe.application" or something?

The combo box thing was going to be my next question actually. If you can put that sample database on, that'd be very useful.

Thanks again!
 
iahclarke,

Here is the sample I promised;
1= Open the tables and change the name and paths for both types (word and PDF).

2= Open frmOpenPDF in design view / Alt+F11 and make sure you change the path of your acrobat .exe file.

Then it should work fine for you.
 

Attachments

Users who are viewing this thread

Back
Top Bottom