By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,053 Members | 954 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,053 IT Pros & Developers. It's quick & easy.

Can you check for Windows File-type Association

P: n/a
Rob
I have an Access application that allows users to open up certain
files from within Access (.doc files with automation, .pdf's with a
pdf viewing form). Other formats, we want to use Internet Explorer to
show, using a plug-in).
THis works fine as long as they have the plug-in installed. If they
don't have the plug-in, when I try to open the file with IE, it gives
the old "Would you like to OPEN this file or SAVE it to disk?" and it
displays the full path to the file. We want to hide the location of
the files, so we either need to eliminate that piece of the dialog
box, or don't allow the dialog to pop up at all. I guess if we could
test to see whether or not they have a valid "file association" in
windows for the filetype they are trying to open, we could provide our
own message about loading the plug-in and then NOT show the dialog to
open/save.
Any help would be appreciated.
Rob
Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
si****@ensco.com (Rob) wrote:
I have an Access application that allows users to open up certain
files from within Access (.doc files with automation, .pdf's with a
pdf viewing form). Other formats, we want to use Internet Explorer to
show, using a plug-in).
THis works fine as long as they have the plug-in installed. If they
don't have the plug-in, when I try to open the file with IE, it gives
the old "Would you like to OPEN this file or SAVE it to disk?" and it
displays the full path to the file. We want to hide the location of
the files, so we either need to eliminate that piece of the dialog
box, or don't allow the dialog to pop up at all. I guess if we could
test to see whether or not they have a valid "file association" in
windows for the filetype they are trying to open, we could provide our
own message about loading the plug-in and then NOT show the dialog to
open/save.


I know there are API calls for determining what file extensions belong to what
programs. I just saw a title to an article at vbnet.mvps.org yesterday.

Presumably there is an API call for IE as well. If you don't get But you'd have to
do some digging. I'd suggest starting at groups.google.com if you don't get an
answer here.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 13 '05 #2

P: n/a
Tony Toews <tt****@telusplanet.net> wrote in
news:2l********************************@4ax.com:
si****@ensco.com (Rob) wrote:
I have an Access application that allows users to open up certain
files from within Access (.doc files with automation, .pdf's with
a pdf viewing form). Other formats, we want to use Internet
Explorer to show, using a plug-in).
THis works fine as long as they have the plug-in installed. If
they don't have the plug-in, when I try to open the file with IE,
it gives the old "Would you like to OPEN this file or SAVE it to
disk?" and it displays the full path to the file. We want to hide
the location of the files, so we either need to eliminate that
piece of the dialog box, or don't allow the dialog to pop up at
all. I guess if we could test to see whether or not they have a
valid "file association" in windows for the filetype they are
trying to open, we could provide our own message about loading the
plug-in and then NOT show the dialog to open/save.
I know there are API calls for determining what file extensions
belong to what programs. I just saw a title to an article at
vbnet.mvps.org yesterday.


I don't know the APIs. But maybe delving into the ShellExecute code
on the Access web might give some clues.

Then again, maybe not, as it's probably using the native API that
does all the determination of the application to load in its
internal workings.

Then again, just Googling a bit, I came up with this about
ShellExecute:

http://www.mentalis.org/apilist/ShellExecute.shtml

And that has an error code for no file association.
Presumably there is an API call for IE as well. If you don't get
But you'd have to do some digging. I'd suggest starting at
groups.google.com if you don't get an answer here.


Why program to IE, a browser that is no longer in development, and
for which there will be no more updates independent of OS service
packs, when you could handle the problem in a way that makes your
solution browser-agnostic?

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #3

P: n/a
Rob
"David W. Fenton" <dX********@bway.net.invalid> wrote in message news:<Xn**********************************@24.168. 128.78>...
Tony Toews <tt****@telusplanet.net> wrote in
news:2l********************************@4ax.com:
si****@ensco.com (Rob) wrote:
I have an Access application that allows users to open up certain
files from within Access (.doc files with automation, .pdf's with
a pdf viewing form). Other formats, we want to use Internet
Explorer to show, using a plug-in).
THis works fine as long as they have the plug-in installed. If
they don't have the plug-in, when I try to open the file with IE,
it gives the old "Would you like to OPEN this file or SAVE it to
disk?" and it displays the full path to the file. We want to hide
the location of the files, so we either need to eliminate that
piece of the dialog box, or don't allow the dialog to pop up at
all. I guess if we could test to see whether or not they have a
valid "file association" in windows for the filetype they are
trying to open, we could provide our own message about loading the
plug-in and then NOT show the dialog to open/save.
I know there are API calls for determining what file extensions
belong to what programs. I just saw a title to an article at
vbnet.mvps.org yesterday.


I don't know the APIs. But maybe delving into the ShellExecute code
on the Access web might give some clues.

Then again, maybe not, as it's probably using the native API that
does all the determination of the application to load in its
internal workings.

Then again, just Googling a bit, I came up with this about
ShellExecute:

http://www.mentalis.org/apilist/ShellExecute.shtml

And that has an error code for no file association.
Presumably there is an API call for IE as well. If you don't get
But you'd have to do some digging. I'd suggest starting at
groups.google.com if you don't get an answer here.



Why program to IE, a browser that is no longer in development, and
for which there will be no more updates independent of OS service
packs, when you could handle the problem in a way that makes your
solution browser-agnostic?


Thanks to you both for your help. I found EXACTLY what I wanted at
the Access Web at http://www.mvps.org/access/modules/mdl0013.htm
Code courtesy of Dev Ashish.
Thanks!

As far as using IE, is it going away? I just used it because I could
open a variety of files with it (some via a plug-in). How could I
allow users to open a file (from inside my app) of unknown file-type,
when I don't know if the user will have an app available to open it?
(making my app more browser-agnostic)
Anyway, thanks for your help.
Nov 13 '05 #4

P: n/a
si****@ensco.com (Rob) wrote in
news:bd*************************@posting.google.co m:
As far as using IE, is it going away? . . .
As a separate, downloadable, product, yes, it's going away.

The security fixes to IE in WinXP SP2 (which are essential to having
the most minimal level of safety) are not scheduled to be broken out
for download as separate patches, so WinXP SP2's IE is going to be
the only one with even the most minimal security.
. . . I just used it because I could
open a variety of files with it (some via a plug-in). How could I
allow users to open a file (from inside my app) of unknown
file-type, when I don't know if the user will have an app
available to open it? (making my app more browser-agnostic)


I explained an avenue of how to go about this in describing the
ShellExecute article -- the ShellExecute API returns an error value
when there is no app installed to execute a file type. If you
trapped for that error, you could then create your own prompt for
the user based on that.

If you don't understand the ShellExecute code there, then post to
the group and I'm sure folks here will help you through it.

As to browser-agnostic techniques, I don't understand, given all the
myriad weaknesses in IE's security and the numerous really dangerous
exploits that have caused CERT to advise users to install non-IE
browsers, I don't understand why anyone in their right mind would be
using IE at this late date.

It lacks so many features and is slower than the Mozilla-based
browsers.

Coding to its specific API (assuming it hasn't changed with every
major IE release, which I wouldn't bet 10 cents on) would be tying
your users to the worst browser available today.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.