Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Congratulations for your great site. This site helped me more than university..."

Geography

Where in the world do Tek-Tips members come from?
LouieGrandie (TechnicalUser)
13 Apr 12 15:18
I have code to open any document based on what is entered in a field.

Private Sub Command13_Click()

    Dim strInput As String

    On Error GoTo Error_GetMTR
    strInput = Attachment
    Application.FollowHyperlink strInput, , True
    

Exit_GetMTR:
    Exit Sub

Error_GetMTR:
    MsgBox Err & ": " & Err.Description

    Resume Exit_GetMTR

End Sub

Works great. The problem is that if the document is a PDF it just flashes on the screen and does not stay open. If it is a Word doc or Excel file it stays open just fine. Any thoughts on how to get the PDF to stay open?

Visit Sage's Online Community
http://community.sagemas.com/sagemas/?category.id=SageMAS90and200Disc  

lameid (Programmer)
13 Apr 12 16:54
Application.Followhyperlink worked for me with a literal instead of strInput on the immediate Window.

What happens if you navigate to the path stored in strInput and double click the file to open it?
LouieGrandie (TechnicalUser)
13 Apr 12 17:02
If I go the file and double click on it the file opens just fine. Just tested and if I put the exact path in the code the same thing happens.  

Visit Sage's Online Community
http://community.sagemas.com/sagemas/?category.id=SageMAS90and200Disc  

lameid (Programmer)
13 Apr 12 17:40
Not what I expected...  I have some thoughts, with luck one of them will pan out.

Does it work differently on other machines (assuming at work)?

If the file is not on your computer, does it work if it is?

Where is it that it doesn't work... Ask IT why it wouldn't work because of some security product.
PHV (MIS)
13 Apr 12 18:04

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close