Solved

Display simple HTML or RTF in Excel user Form

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

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.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

786 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