Using a macro to open a pdf document

  • Thread starter Thread starter Dazza
  • Start date Start date
D

Dazza

Hi all,

Can someone show me a method whereby a control button on
a form will open up a specific pdf document? I have tried
using "Run App" and keep getting an error message.

Many thanks,
Dazza
 
Dazza said:
Hi all,

Can someone show me a method whereby a control button on
a form will open up a specific pdf document? I have tried
using "Run App" and keep getting an error message.

Try ShellExecute

http://www.mvps.org/access/api/api0018.htm

If that seems like too much for you right now, and pdf's are a registered
filetype, then you can use a hyperlink, or just the simple code for a
hyperlink in a label or button:

Private Sub Form_Current()
Me.Label1.HyperlinkAddress = "C:\FolderName\FileName.pdf"
End Sub

Then all you need to do is click on the label or button.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top