Solved

Display simple HTML or RTF in Excel user Form

Posted on 2013-06-05
3
773 Views
Last Modified: 2013-06-06
I have a feeling I cannot do what I want to do, but I am hoping an expert can give me guidance.

My current application menu system shows several options in Listbox1 on Userform1:
ShowOrders
EditOrders
ShowCustomers

When the user right clicks an option, the listbox1_mouseup routine shows detailed instructions by opening a corresponding word document, from "c:\DetailedInstructions\ShowOrders.doc".

This is very slow, so I want to put a shorter version of the instructions directly under Listbox1 on the form.  

I added a 1 inch by 4 inch control to the form:  Userform1.WebBrowser1

then added this code to listbox1_mouseup:

 
 userform1.webbrowser1.navigate "c:\ShortInstructions\ShowOrders.HTM"

Open in new window


This works nicely except for one thing.   when the user clicks inside userform1.Webbrowser1, I want the hyperlinks to open "outside" of webBrowser1.

For instance let's say c:\ShortInstructions\ShowOrders.HTM contains two hyperlinks:
Hyper1 is  to "c:\DetailedInstructions\ShowOrders.doc"
Hyper2 is to "www.msnbc.com"

When user clicks Hyper1, Word should open
When user clicks Hyper2 msnbc should open using Chrome, Firefox or IE depending on the users default browser.

Am I out of luck?

By the way, I do not insist on an HTML solution.  I will accept RTF or Wiki Formatting or any other solution that can be implemented with less than an hour or two of coding.

rberke
0
Comment
Question by:rberke
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
[ fanpages ] earned 500 total points
ID: 39224455
Hi,

When user clicks Hyper1, Word should open
When user clicks Hyper2 msnbc should open using Chrome, Firefox or IE depending on the users default browser.

I achieved this by adding a "base" tag to the "ShowOrders.HTML" file.

For example, adding <base target="_blank">

---
<html>
<head>
<base target="_blank">
</head>
<body>
<a href="file://c:\DetailedInstructions\ShowOrders.doc">Document</a>
<p>
<a href="http://www.msnbc.com">MSNBC.com</a>
</body>
</html>
---

BFN,

fp.
ShowOrders.HTM
0
 
LVL 5

Author Comment

by:rberke
ID: 39225864
Thanks a ton - that works perfectly.

Bob
0
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 39225996
You're very welcome.

Good luck with the rest of your project.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question