Jay
Tue Aug 16 15:46:01 CDT 2005
Larry wrote:
> I used to know this but forget--If a text selection has character
> formatting such as underlining, and I'm turning the selection into a
> string and then inserting that string elsewhere, how do I maintain the
> formatting of the string?
If you turn it into a string, you *will* lose all formatting, because a
string has no place to store format information -- it's just a list of
character codes.
To preserve formatting, you can define a range for the destination, and
assign the source range to the .FormattedText property of the destination:
DestRg.FormattedText = Selection.Range
or, if you have a Range object SourceRg instead of the Selection,
DestRg.FormattedText = SourceRg
Look up the FormattedText property in the VBA help.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ:
http://word.mvps.org