Bypass hyperlink prompt in VBA?

R

Robert Bonds

Am having a bit of a problem with the following line of VBA code activated
from a command button on a form I've designed in Access 2007:

Application.FollowHyperlink Me.DocumentFilePath

This works fine when the file being opened is a PDF, Excel file, Word
document, etc. But when the file to be opened is a saved e-mail message (.msg
file), a prompt always pops up: "Some files can contain viruses or otherwise
be harmful to your computer... It is important to be certain that this file
is from a trustworthy source. Would you like to open this file?"

Any e-mail messages being opened this way will always be from trustworthy
sources, and will already have been screened for viruses. So I'm wondering if
there's a way to bypass this prompt? It appears to be coming from outside
Access, since inserting a "DoCmd.SetWarnings False" line just before the
above code has no effect.

Any suggestions would be greatly appreciated. Thanks.
 
A

Allen Browne

You may be able to avoid the issue by using a complete hyperlink (with the
file prefix and both the display and address parts.)

This kind of thing:

Dim strDoc As String
strDoc = "file:///" & Me.DocumentFilePath & "#" & Me.DocumentFilePath
FollowHyperlink strDoc
 
J

Jack Leach

Application.FollowHyperlink has this downfall, being that the OS opens the
file as if you found it on the web somewhere. Instead, try the ShellExecute
API. I've never opened a .msg file with it, but for every other filetype
where a security prompt is present using FollowHyperlink, the API will open
it wthout warning.

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


hth

--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
R

Robert Bonds

Jack, the ShellExecute API does the job. It works perfectly! Thanks for the
tip.

Allen, thanks for the suggestion regarding the complete hyperlink. It didn't
work in this case, but I can already think of other areas where it will come
in handy, so am glad to have your feedback.

Arvin, thanks too for telling me about Outlook Redemption. Since the
ShellExecute API worked in this limited case, I haven't explored this plug-in
yet, but it looks like it could well provide an answer to the next 937
problems on my list! So am very glad to know about this – thanks much.

Robert Bonds

======
 
T

tom_willpa

high quality Soccer jerseys NBA Jersey tracksuit and jackets, GHD
hairstraightener supplier from www.willpa.com

Are you a Retail businessman who bother by the purchase price? China
Cheapest TOP wholesale website can help you

we are specialize in replica sport goods manufacturing in china, we can
offer you all kinds of soccer jersey, NBA jersey,shoes and so on. they are
the best brand replica goods whih are look the same as the original goods.
excellent quality and steady supply for them. we have been marketed in Europe
and American for 3 year. all the goods we offer are AAA quality. our soccer
jersey are Thailand style. If any goods you buy from my company have problem,
we will refund or resend them again. Most of ourProducts have no minimum
order requirements,soyou can shop retail goods at wholesale prices. if you
can buy more than 300usd. We offer free shipping. The more you buy the more
discount for you.

National soccer jerseys: http://www.willpa.com
Club soccer jerseys: http://www.willpa.com
NBA Jerseys: http://www.willpa.com
T-shirt and shirt: http://www.willpa.com
Tracksuit: http://www.willpa.com
Hoody & Jackets: http://www.willpa.com
UGG boots: http://www.willpa.com
Hair style: http://www.willpa.com
shopping Index: http://www.willpa.com

EMS shipping. 7days arrive, paypal accept

want more information pls contact us or check our website: www.willpa.com
 
T

tom_willpa

high quality Soccer jerseys NBA Jersey tracksuit and jackets, GHD
hairstraightener supplier from www.willpa.com

Are you a Retail businessman who bother by the purchase price? China
Cheapest TOP wholesale website can help you

we are specialize in replica sport goods manufacturing in china, we can
offer you all kinds of soccer jersey, NBA jersey,shoes and so on. they are
the best brand replica goods whih are look the same as the original goods.
excellent quality and steady supply for them. we have been marketed in Europe
and American for 3 year. all the goods we offer are AAA quality. our soccer
jersey are Thailand style. If any goods you buy from my company have problem,
we will refund or resend them again. Most of ourProducts have no minimum
order requirements,soyou can shop retail goods at wholesale prices. if you
can buy more than 300usd. We offer free shipping. The more you buy the more
discount for you.

National soccer jerseys: http://www.willpa.com
Club soccer jerseys: http://www.willpa.com
NBA Jerseys: http://www.willpa.com
T-shirt and shirt: http://www.willpa.com
Tracksuit: http://www.willpa.com
Hoody & Jackets: http://www.willpa.com
UGG boots: http://www.willpa.com
Hair style: http://www.willpa.com
shopping Index: http://www.willpa.com

EMS shipping. 7days arrive, paypal accept

want more information pls contact us or check our website: www.willpa.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top