Solved

Display simple HTML or RTF in Excel user Form

Posted on 2013-06-05
3
691 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now