Printable Version of Topic

Click here to view this topic in its original format

UtterAccess Forums _ Microsoft Internet Explorer _ Opening A Jpeg With Windows Photo Viewer

Posted by: LeeAnn May 31 2019, 03:10 PM

I hope I am posting this in the right forum, if not someone can move it if they want. I have a series of links that open up jpg files. They open in Internet Explorer which opens them up but the image is on the left side of the screen and it just looks bad. I want instead to use Windows Photo Viewer instead which opens them image centered. Is there a way in html to tell the link to use that application? I hope I explained that well. Also Chrome and Firefox opens the images fine in the center, why does IE not do that?????

Posted by: theDBguy May 31 2019, 03:15 PM

Hi. If they are links, then IE (or whichever is your default Internet browser) will take over. Have you tried right-clicking the links and select Open or View image, or something else?

Posted by: LeeAnn May 31 2019, 03:48 PM

That will not do. I need for it to open like that for everyone. I have an Intranet site that I work with and I would like to have Internet Explorer to get out of the way and use something that knows how to open images nicely (lol). I love how Chrome opens the images up but IE is being the typical piece of software I just love (not really) and opens the pictures in an ugly way. I would like to have the pictures open up in the center of the screen. I know there has to be a better way. If I can get the pictures to open up in Windows Photo Viewer which puts the pictures in the center of the screen nice and pretty. Not sure why IE is like this but it does not surprise me, there are a lot of things I do not like about IE. I had hoped Edge would better but I have tested it with that and nope, the pictures are all left justified.

thumbdn.gif <Rant> I can maybe understand the reasoning behind IE opening up everything that it can, but if you make it open up ugly...... This is one of the many reasons I don't care for IE and don't use it outside work. <End of Rant>

Thanks for the help DBGuy, I hope someone can give me an answer.

Posted by: DanielPineault May 31 2019, 04:43 PM

Short answer is no.

Perhaps you could setup a modal window with the layout/formatting as you want it and open links there that way you have some level of control and no matter what browser is used (or is the user's default browser) you guarantee the look/feel. Just a thought.

Posted by: theDBguy May 31 2019, 05:51 PM

Okay then, let's back up a bit, you said you have some links you click, where are these links located? On a HTML page?

Posted by: jleach Jun 2 2019, 07:00 PM

You can't easily do it from HTML, for security reasons (imagine going to a random webpage that allowed any given link to specify the program and parameters to run on your own computer... that'd be an open door to rampant malware).

It is possible, but probably not feasible. You can specify an application protocol and use the application protocol to run something on the local machine with a special link (e.g., sometimes you can go to a web meeting or some other special type of file/applet, and after you install the applet on your computer and tell your browser it's allowed to run, you can join a web meeting (or whatever) with it: it's the same setup). So, you need a) a custom application on each client machine that will open the desired application via application protocol in the html link. Possible, but not generally feasible.

Another solution (again possible, and still probably not feasible, but perhaps more feasible than an application protocol), is to sync javascript events from the HTML to VBA, then use VBA to ShellExecute the correct application (photo viewer) to the path in question. This is easier than an app protocol, but still a bit of work to set up, requiring a web browser control to load the page, a spot of custom JS to intercept the click event on the link, then a special class in VBA to receive that event (and a registry setting for browser emulation, most likely). If this is an avenue you want to explore, do a search for "Dymeng Browse Embed" and you should find a web page on my site that has a sample of "embedded html/js in VBA", which uses the same event receipt concept (although that demo uses charting, it can be adapted). Admittedly, this demo is not set up wonderfully and has the quality of a proof of concept rather than a "drop and go" piece of work, so some heavy wrenching around may be required.

Another idea is that there may be a setting on the local machines which control the default behavior of IE (or perhaps a registry hack you can try).

All in all though, my main question would be the same as Leo's: where is this image/path/html located? If we know that, we can narrow in on options (maybe we're lucky and it'll be a simple fix!)


Posted by: jleach Jun 2 2019, 07:05 PM

Just thought too, if this isn't related to Access/VBA in any way and is purely an IE question, maybe you can find an add-on for IE that will do what you're looking for? Might be something that enough people have been irked about that someone went and made one (or something that'll get you similar results, like a chrome-ish viewer, or whatever).

Posted by: LeeAnn Jun 3 2019, 07:58 AM

The links are located in HTML page. I think I am just going to have to be content with the clunky way IE opens up the jpgs though. It looks so ugly, but there seems to be no easy way to get what I want.

Thanks for all the help, the answers were what I sort of expected I would get.

Thanks again....

Posted by: GroverParkGeorge Jun 3 2019, 08:01 AM

"The links are located in HTML page."

And where do the images open, in the same page, in a new page in the same browser instance?

Posted by: theDBguy Jun 3 2019, 08:33 AM

Hi. Do you have control over this HTML page, meaning, can you modify it?

Posted by: LeeAnn Jun 3 2019, 10:47 AM

Yes I can modify it.

Posted by: theDBguy Jun 3 2019, 11:54 AM

Okay, just as a long shot, I tried searching for maybe some sort of JavaScript you can use to execute when the user clicks on the link. But as Jack said, the consensus is this could potentially be dangerous, and the ones I found and tried didn't quite work out. You might try searching for it yourself and maybe you'll get lucky. Cheers!

Posted by: DanielPineault Jun 3 2019, 12:44 PM

I still don't get why you wouldn't just employ a modal popup to display it in the manner you would like. You say you like the way Chrome handles it, well, with a modal, you could emulate that or do even better.

Javascript is often blocked for security reason and there is not guarantee (unless this is within an organization and you can control such settings). Even with Javascript, you typically would need to setup the registry, ... which can become tedious to do on all your users PCs.

For the javascript approach you could look over and

Posted by: LeeAnn Jun 3 2019, 02:38 PM

I suppose I should have stated that I am pulling the pictures from LiveLink (don't know if any of you are familiar with that). Not sure if a modal would popup would work but it might be something to look into but I do not think I can get a document from LiveLink into something like that. Just irks me that Microsoft does not go for what looks good, just get the functionality to work. Centering graphics on a screen looks so much better....

Thanks again for the help. Again I think I may have to just accept the ugliness of IE and how it opens graphic files.

Posted by: GroverParkGeorge Jun 3 2019, 05:47 PM

I'm not sure this is fair or accurate. "Microsoft does not go for what looks good, just get the functionality to work." A lot of people might argue that the opposite has too often been true. Shiny interfaces over solid performance (think Office ribbon vs menus).

Frankly, if you work much at all with HTML in a browser, you quickly learn that there is almost too much twiddling available. Centering, aligning left, etc., etc., etc. All features of html.

What is happening here is that you are saying the DEFAULT behavior doesn't suit your needs in this case. Okay, but if the DEFAULT is not what you want, perhaps it's a matter of learning how to modify the html accordingly.

"Centering graphics on a screen looks so much better..."

Like many UI considerations, beauty is in the eye of the beholder to a large degree, wouldn't you think? What one person prefers may, or may not be what another person prefers. Again, if this is a crucial feature of your application, which apparently is being developed for that environment using a tool like Visual Studio or other such application, perhaps the key is to master that application's features and functions for the IE environment.

There can be a counter-argument that each browser should not go off on its own in how it handles rendering, but that would eliminate the need for all but one browser....

In the end, I think Daniel's suggested approach makes the most sense. Figure out how to take advantage of your software to get the results you want.

Posted by: LeeAnn Jun 5 2019, 03:29 PM

Well I looked up and down for a way to get the Livelink link to open using a modal popup but no success. This has frustrated me to no end. I hate saying something cannot be done, but in this instance I am going to throw in the towel for now.

I know I made some bad remarks regarding IE, I get so frustrated when I cannot get something to work the way I would like. I loved the way Chrome opens up the jpegs, it looks better having the pictures centered.

Thanks everyone for the assistance. I actually got to learn quite a bit about a few things.

Posted by: theDBguy Jun 5 2019, 03:35 PM

Hi LeeAnn. Sorry to hear you didn't find a suitable solution. Did you try using JavaScript?

Posted by: DanielPineault Jun 5 2019, 06:32 PM


Take a look at the following little demo I put together for you. I don't know if this will work with live link, but it may be worth a quick try. ( 65.14K ): 3

Posted by: LeeAnn Jun 26 2019, 09:45 AM

I may look at it Daniel but I think I found a way to get the thing to work (not like I want but good enough for me to be happy with). I placed the LiveLink link as the image source on the web page (I did not think this would work because it was so simple so I did not bother trying at first). I opened the page and it brought the image up in the center of the screen after I made the style for it. Really funny as I should have tried it the first time. I am getting the customer to look at the work and am hoping they are happy with it. I just don't like things that look ugly and having the picture line up on the left of the screen just does not look good.

Moral of the story, sometimes you have to think simple. Thanks for the help everyone.

Posted by: theDBguy Jun 26 2019, 09:54 AM

Hi. Congratulations! Glad to hear you found a working solution. Good luck with your project.

Posted by: DanielPineault Jun 26 2019, 02:29 PM

Moral of the story, sometimes you have to think simple.

Isn't that the truth. We so often get in our own way by over thinking things. That's why these forums are great sounding boards. How many times have fellow developers told me 'just do this' or 'use this built-in function' when I was trying to develop custom code... But these situations also help us grow as developers. Mistakes and problems like this one are great learning tools/opportunities!

The webbrowser control can actually be quite a nice thing, since it can allow you to bring powerful web libraries 'into' access. So you can add functionalities that are part of Access, from the realm of the web, into Access. For instance, to do some awesome charting you can use in combination with data from your tables. The sky is the limit!

Posted by: Rajeshraj1990 Oct 8 2019, 12:43 PM

Thanks for this information. It useful