Solved

Display simple HTML or RTF in Excel user Form

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
This article describes a serious pitfall that can happen when deleting shapes using VBA.
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 …
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…

751 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