Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default Make string bold?

How do I make a string bold in VB code? I am trying to export to work, but if
I make the bookmark bold it makes everything bold. This is because I have two
bookmarks next to each other. I wish to know if there is a way to do it on
the VB side as it's processing the bookmark:

This is the code that I am using:
x.ActiveDocument.Bookmarks("ExtScopePrep").Range.T ext = String1 & vbCr &
"Preparation as stated above" & vbCr 'Worksheets("Ext Quote").Cells(Row,
2).Value & vbCr

Thanks!!
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Make string bold?

Turn on the macro recorder and then bold the desired text. Turn off
the recorder and switch to the VBE for the code.

It would appear you are doing the editing in Word. If so, you cannot
select text once the macro recorder is turned on.

An example of making the last 1/2 of the text in a document bold is:
Sub testIt()
With ActiveDocument
.Range(.Characters.Count / 2, .Characters.Count).Font.Bold = True
End With
End Sub

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
How do I make a string bold in VB code? I am trying to export to work, but if
I make the bookmark bold it makes everything bold. This is because I have two
bookmarks next to each other. I wish to know if there is a way to do it on
the VB side as it's processing the bookmark:

This is the code that I am using:
x.ActiveDocument.Bookmarks("ExtScopePrep").Range.T ext = String1 & vbCr &
"Preparation as stated above" & vbCr 'Worksheets("Ext Quote").Cells(Row,
2).Value & vbCr

Thanks!!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to apply bold within string text dragonball20cal Excel Worksheet Functions 7 July 23rd 07 03:18 AM
Bold in string concatenation Steen Excel Discussion (Misc queries) 12 November 7th 06 12:49 AM
macro to bold number of chars from end of a string herbwarri0r Excel Discussion (Misc queries) 4 June 6th 06 01:21 PM
Bold a portion of concatenated string joeeng Excel Discussion (Misc queries) 1 December 8th 05 08:26 PM
How do I make this string bold? Adam Excel Programming 1 March 9th 05 02:56 AM


All times are GMT +1. The time now is 04:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"