Solved

Display simple HTML or RTF in Excel user Form

Posted on 2013-06-05
3
886 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

622 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