Access 2002 design

  • Thread starter Thread starter Gino
  • Start date Start date
G

Gino

I cannot open a word document when I click a command
button on the form. It will give me a message of "File not
found" even though I created the command button using the
wizard. The path I use to create the command button is as
follows:
- I add the command button on the form
- Wizard pops up, then I select Applications on the
categories
- I choose Run Application under actions
- Next
- I type Word.exe c:\test.doc
- Next
- I choose text and type "Open Test" on the text box
- Next then Finish

When I run the application and click on the Open Test
on the command button it gives me a message file not
found, even though the "test.doc" document is stored on C:
drive. Does anyone know the answer to this ? Please
help... Thanks in advance

*********************************************************
Subject: Re: Access 2002 design
From: "Brendan Reynolds \(MVP\)" <[email protected]>
Sent: 12/9/2003 4:30:27 AM

The main executable for Microsoft Word is not
named 'word.exe', it is
'winword.exe'.

--
Brendan Reynolds (MVP)
(e-mail address removed)
*********************************************************

Thanks for the suggestion Brendan, but unfortunately it
still did not work, is there any other solution for this ?
Any other suggestions will be appreciated .... THANKS

Gino
 
It works fine for me.

If C:\test.doc is only an example on the post and your
actual full pathname to your doc file has spaces or
special characters, you need to enclose the full pathname
in double-quotes. For example, the folllowing works for
me:

stAppName = "WINWORD.EXE " & _
"""C:\Documents and Settings\vdinh\Desktop\" & _
"PE 002 Pressure.doc"""
Debug.Print strAppName 'for checking only
Call Shell(stAppName, 1)

HTH
Van T. Dinh
MVP (Access)


-----Original Message-----
I cannot open a word document when I click a command
button on the form. It will give me a message of "File not
found" even though I created the command button using the
wizard. The path I use to create the command button is as
follows:
- I add the command button on the form
- Wizard pops up, then I select Applications on the
categories
- I choose Run Application under actions
- Next
- I type Word.exe c:\test.doc
- Next
- I choose text and type "Open Test" on the text box
- Next then Finish

When I run the application and click on the Open Test
 
Hopefully, Van's example should help you to solve the problem. But if not,
try posting the actual code from the button's click event, then we may be
able to see what the problem is.
 
Back
Top