Opening files from a form with a cmd btn

  • Thread starter Thread starter Brad
  • Start date Start date
B

Brad

I have a command button that opens a pdf file when clicked, I have 2 questions
1. how do you force the file to be opened in a web browser (IE)?
2. can all the warning dialogs be suppressed

The code behind the button I am using is as follows

Application.FollowHyperlink Me.Text43
 
On Fri, 6 Mar 2009 05:33:01 -0800, Brad

You can't force that with FollowHyperlink. It will open the document
in the default viewer for that document type.
If you really need that, you'll have to look into using Automation
with IE.

-Tom.
Microsoft Access MVP
 
Aa a starting point try something like this:
Public Sub OpenWebPage(url As String)

Dim browser As Variant

Set browser = CreateObject("InternetExplorer.Application")
browser.Navigate (url)
browser.StatusBar = False
browser.Toolbar = False
browser.Visible = True
browser.Resizable = True
browser.AddressBar = False


End Sub
 
ok I can buy that, but when I click the cmd button it only brings adobe to
focus, It will not open the doc itself though, I have 7.0 std installed in
addition to 9.0 reader
 
You could put it anywhere. I have it in a regular module, then for example
on the click event of the button you would
have Call OpenWebPage(http://www.yahoo.com)

of course you would build the url you are passing the the function
appropriately for your needs.

Mark
 
Back
Top