PC Review


Reply
Thread Tools Rate Thread

Bypass hyperlink prompt in VBA?

 
 
Robert Bonds
Guest
Posts: n/a
 
      29th Mar 2010
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.

 
Reply With Quote
 
 
 
 
Arvin Meyer [MVP]
Guest
Posts: n/a
 
      29th Mar 2010
I'm not sure if this would work, but it does intercept other Outlook
security measures:

http://www.dimastr.com/redemption
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access


"Robert Bonds" <(E-Mail Removed)> wrote in message
news:9ECAE0BE-EAB6-45B3-B3D7-(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
Allen Browne
Guest
Posts: n/a
 
      29th Mar 2010
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


--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Robert Bonds" <(E-Mail Removed)> wrote in message
news:9ECAE0BE-EAB6-45B3-B3D7-(E-Mail Removed)...
> 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.
>

 
Reply With Quote
 
Jack Leach
Guest
Posts: n/a
 
      29th Mar 2010
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)



"Robert Bonds" wrote:

> 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.
>

 
Reply With Quote
 
Robert Bonds
Guest
Posts: n/a
 
      30th Mar 2010
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

======

"Jack Leach" wrote:

> 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)
>
>
>
> "Robert Bonds" wrote:
>
> > 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.
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
New tool available to selectively bypass the UAC prompt Ronnie Vernon MVP Windows Vista General Discussion 6 1st Jan 2008 03:21 PM
Can't bypass win 2k logon prompt / over top install? Dan Microsoft Windows 2000 3 4th Sep 2005 10:22 PM
Bypass Welcome screen & logon prompt =?Utf-8?B?UkphbmU=?= Windows XP Accessibility 3 24th Oct 2004 02:56 AM
Re: Bypass Login prompt Laura E. Hunter \(MVP\) Microsoft Windows 2000 Security 0 26th Aug 2004 03:40 PM
have Telnet bypass login prompt(s)? Dan Schullman Windows XP Embedded 3 24th Oct 2003 04:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:41 PM.