Office Nag Message Appears When Opening Hyperlink

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BikeToWork
    New Member
    • Jan 2012
    • 124

    #1

    Office Nag Message Appears When Opening Hyperlink

    I have an Access 2007 application that generates a pdf report. Before I switched domains, the pdf files would open without issue from Access. After I switched to the new domain, I get an extremely annoying nag about "Potentiall y dangerous files. Are you sure you want to open this file?" I tried the regedit fix I found online and also changed the setting in Trust Center about "Check Microsoft Office documents that are from or link to suspicious websites." Neither worked. My code uses the FollowHyperlink method to open the pdf. Is there another way to open a pdf which would circumvent the nag? Does anyone know a fix for this issue? Thanks in advance for any guidance.
  • jforbes
    Recognized Expert Top Contributor
    • Aug 2014
    • 1107

    #2
    I use this function to open URLs, I haven't had any trouble with it. It would be sidestepping your problem.

    Code:
    Function OpenAttachment(ByVal sTargetAndLocation As String) As Boolean
        OpenAttachment = False
        Dim dReturn As Double
            
        dReturn = Shell("explorer.exe " & sTargetAndLocation, vbNormalFocus)
        If dReturn >= 0 Then OpenAttachment = True
    End Function
    Last edited by jforbes; Sep 26 '14, 07:45 PM. Reason: I probably should be using an Integer for the return code.

    Comment

    • BikeToWork
      New Member
      • Jan 2012
      • 124

      #3
      That works a treat. Thanks a megabyte. Why it lets Shell open the link, but will not allow FollowHyperlink to open it is not readily apparent.

      Comment

      • zmbd
        Recognized Expert Moderator Expert
        • Mar 2012
        • 5501

        #4
        Home for a quick lunch and back out:

        This is what I have used for years and doesn't require the shell:
        Hyperlinks: warnings, special characters, errors - Allen Browne

        Comment

        Working...