Opening a certain word document with a macro from within Access.

G

Guest

I'm trying to open a certain word document with a macro from within Access
but I'm having some problems. Can someone help please?

This is the command line I'm trying to use:
WINWORD.EXE "<Drive>:<Path with extension>"

Does it matter how I open up word?
 
M

M.L. Sco Scofield

Yes. It matters big time.

Depending on what you are trying to do with the document once it's open, you
most likely need to be using "Automation."

Download the Office Automation Help File. It's loaded with all kinds of good
information. BTW, it would be real handy to include what version of Access
(or Office) you are using.

Office 97: http://support.microsoft.com/default.aspx?scid=kb;en-us;167223
Office 2000: http://support.microsoft.com/default.aspx?scid=kb;en-us;260410
Office XP (Also applies to 2003):
http://support.microsoft.com/default.aspx?scid=kb;en-us;302460

Good luck.

Sco

M.L. "Sco" Scofield, Microsoft Access MVP, MCSD, MCP, MSS, A+
Denver Area Access Users Group Vice President www.DAAUG.org
MS Colorado Events Administrator www.MSColoradoEvents.com
Useful Metric Conversion #18 of 19: 8 nickels = 2 paradigms (My personal
favorite)
Miscellaneous Access and VB "stuff" at www.ScoBiz.com
 
A

Albert D. Kallal

If you are *just* trying to open up the document, then use:


Application.FollowHyperlink "c:\my docuemnts\test.doc"

The above would open the docuemnt as if you double clicked on it...
 
G

Guest

Ok! Thanks! I forgot I should have included that info:( Well, we're
running Win2k, Office 2002 at our office network with mapped drives. The
access file will be stored on one of the mapped drives and I think this may
have an effect on other things. Am I correct that environment variables such
as "PATH=XX" may effect how it runs? Trying to use:

WINWORD.EXE "<Drive>:\<Path & Document name w/extension>"

We're tying to print that document because some, if not most of that data
will not be in the data base, therefore the need to open and then enter the
data to print.
Thanks again, I'll look over that Automation:)
 
M

M.L. Sco Scofield

If you just want to open the document so that the user can take over from
there, you might try Albert's suggestion. It will be much simpler than
Automation if you don't need to take control of Word from your Access code.

Sco

M.L. "Sco" Scofield, Microsoft Access MVP, MCSD, MCP, MSS, A+
Denver Area Access Users Group Vice President www.DAAUG.org
MS Colorado Events Administrator www.MSColoradoEvents.com
Useful Metric Conversion #18 of 19: 8 nickels = 2 paradigms (My personal
favorite)
Miscellaneous Access and VB "stuff" at www.ScoBiz.com
 
G

Guest

Albert,

I'm using the hyperlink proerty of a label to open a word document, but when
I do that, the Access form is minimized. Is there a way to prevent this? If
not, how can I determine whether the Word document is still open? I'd like
to put some code in the timer event of the form to check to see if the
document has been closed, and if it has, then restore the form.

Dale
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top