RunApp

  • Thread starter Thread starter Guest
  • Start date Start date
Using the action "RunApp" include the argument (Command Line) for the complete path to winword.exe. For example, mine is C:\Program Files\Microsoft Office\Office\winword.exe

I'm not aware of needing anything more than that
Dere

----- scaseres wrote: ----

How can I create a macro in access to open another application such as MS Word
 
Creat a macro useing the Action "RunApp" with the command
line -
"application location&name" "Full filename"

Below is an example I use for access 2000 to open a
specific document. If you want to just open Word leave the
filename off. Watch out for word wrap.

c:\program files\microsoft office\office\winword.exe
c:\mydir\filename

Jim
 
I need something very similar, except I need to know how to
specify a filename using a value in a field. Any ideas?
I've tried it all and can't get it working.

--Chad Easley
-----Original Message-----
Using the action "RunApp" include the argument (Command
Line) for the complete path to winword.exe. For example,
mine is C:\Program Files\Microsoft Office\Office\winword.exe.
 
Chad,

It depends how you identify which record in the table holds the
filename you want (assuming the table has more than one record!), but
just as an example, try this syntax...
=DLookup("[FileName]","YourTable","YourCriteria")
It would possibly be simpler if you could have the required filename
displayed on a currently open form, and then refer to the control on
the form, for example...
=[Forms]![NameOfForm]![NameOfControl]
This assumes that the data is the full path to the file, otherwise if
it is simply the filename itself, you will need something like...
="C:\YourFolder\" & [Forms]![NameOfForm]![NameOfControl]

If you still need more help with htis, please post back with more
details, perhaps with example.

- Steve Schapel, Microsoft Access MVP
 
I'd use the follow hyperlink route, place this code in the OnClick Even
of a button

Code
-------------------

Private Sub YourButton_Click()
On Error GoTo Err_YourButton_Click

Application.FollowHyperlink "C:\Path\NameOfYourFile.xxx"

Err_YourButton_Click:
If Err = 490 Then
Err.Clear
MsgBox ("File not found. Check path and make sure you have a mapped drive to the folder.")
DoCmd.CancelEvent
Else

End If

Exit Sub
End Sub
 
Back
Top