473,413 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

VB Form in MS Word and Italics / Hyperlink

Hi all,

I'm sure this is a really basic question, but here goes anyway!

I have a userForm with some text boxes / check boxes etc and when a user clicks the check box i would like some text to appear in MS Word via a bookmark. This is all working fine, but i would like part of the text paragraph to be in Italics and another part to be a hyperlink.

For example, if i had the following sentence, i would like the word 'fox' to be italicised and the word http://www.lazydog.com to be a hyperlink:

The quick brown fox jumps over the http://www.lazydog.com

How do i make the word 'fox' italics and the other a hyperlink? In html, to make something italics you just surround the word with <I> Fox </I> or whatever, is there something similar in VB?

No doubt its dead easy, but its driving me bonkers :)

Thanks!
Jun 2 '10 #1

✓ answered by QVeen72

Hi,

You want certain part of text in Word Doc to be Italisiced..?

This, I have got from Macro Recording..:

Expand|Select|Wrap|Line Numbers
  1. Selection.TypeText Text:="the quick "
  2. Selection.Font.Italic = wdToggle
  3. Selection.TypeText Text:="brown"
  4. Selection.Font.Italic = wdToggle
  5. Selection.TypeText Text:=" fox "
  6. ActiveDocument.Hyperlinks.Add Anchor:= _
  7. Selection.Range, Address:= _
  8. "http://www.temp.com", SubAddress:="", _
  9. ScreenTip:="", TextToDisplay:="temp"
  10. Selection.TypeText Text:=" Continue text..."
  11.  
Regards
Veena

1 1896
QVeen72
1,445 Expert 1GB
Hi,

You want certain part of text in Word Doc to be Italisiced..?

This, I have got from Macro Recording..:

Expand|Select|Wrap|Line Numbers
  1. Selection.TypeText Text:="the quick "
  2. Selection.Font.Italic = wdToggle
  3. Selection.TypeText Text:="brown"
  4. Selection.Font.Italic = wdToggle
  5. Selection.TypeText Text:=" fox "
  6. ActiveDocument.Hyperlinks.Add Anchor:= _
  7. Selection.Range, Address:= _
  8. "http://www.temp.com", SubAddress:="", _
  9. ScreenTip:="", TextToDisplay:="temp"
  10. Selection.TypeText Text:=" Continue text..."
  11.  
Regards
Veena
Jun 2 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Newbie | last post by:
OK, this may be impossible since I'm using 3rd party shopping cart ASP software, but I've been able to finagle a lot of other stuff I thought wouldn't work, so here we go: I'm using a form in...
3
by: Phil | last post by:
I am looking to set up a hyperlink control on a form to retrieve letters that correspond to a record on a form. That is, there may be 100 form records, and I would like each of those form records...
4
by: Marco Krechting | last post by:
Hi All, Sorry but I have to create new message since it cannot find the old message to send a reply. Coming back to this hyperlink thing I will try to explain the real problem cause I think we...
3
by: hermawih | last post by:
Please help . I want to load the contents of another rtf document by double-clicking the words . Chapter1.rtf Chapter2.rtf Chapter3.rtf ....
1
by: jm | last post by:
<td> <asp:HyperLink id="ORDER_ID" NavigateUrl= '<%# DataBinder.EvalContainer.DataItem, "ORDER_ID")%>' runat="server"> <%# DataBinder.Eval(Container.DataItem, "ORDER_ID") %> </asp:HyperLink>...
2
by: Big E | last post by:
I'm using ASP.Net and SQL Server. I have a table called states. I have 2 forms. On form 1 is the 50 states in textboxes created with a loop. I want to have those 50 or 45 or whatever amount of...
1
by: Lyners | last post by:
I am trying to figure out how to do this. I have created a form on a webpage that shows users that you can edit or delete. I have a hyperlink to another webpage that adds users. The "Add Users"...
3
by: Dominique | last post by:
Hello, I tried: <aw:HyperLink runat="server" id="hlQueuedCount" labelposition="top" labelwidth="30" command="runQuery" /> as if I use the parameter width it just affect the result of the query...
0
by: =?Utf-8?B?UEs5?= | last post by:
I am trying to open a hyperlink that points to a Microsoft Word document in my ASP.NET 2.0 application. The error message is: Path 'OPTIONS' is forbidden I have researched this error but have...
1
by: Ivo | last post by:
Hi, can anybody tell me how to extract images from a word document? thx
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.