Copy text with bullets

D

DJohnson

Everyone:

I am trying to copy text from one document (source) to another document
(destination). The source document's text includes bullets but when I paste
the source document's text into the destination document, I lose the bullets.

I have tried using the Range's TextRetrievalMode but I have not had any luck.

Does anybody have any ideas?

Thanks,
Derek
 
C

Cindy Meister

It always helps to mention the version of Word you're struggling with...

This sounds like a style issue: the style of the same name in the target
document doesn't use bullets.

If this is Word 2002 or 2003, do a search in the VBA Editor on
PasteAndFormat. Ignore the part that makes it seem as if this applies only to
table cells. Some of the wdRecovery enums apply to regular text.
 
D

DJohnson

Cindy,

I am using Word 2003 and Visual Studio 2005.

I have created two ranges to copy text from one document to another. The
first range uses a bookmark that I defined in the source document. This is
the text I want to copy. The second range points to a word in the
destination document that I want the text in source document to replace.

I transfer the text from the first range to the second range using the .Text
attribute.

DestinationRange.Text = SourceRange.Text

In order to place the text into the destination document I use the .Replace
command of the Range object to replace the word in the destination document
with the text in the Range object.

Is there a better way of copying text from one document to another? I
believe the process I have chosen causes the bullet formatting to be lost.

Thanks,
Derek
 
C

Cindy Meister

Hi Derek

Ah :) Try using the Range.FormattedText property on both sides of the
equation. To pick up the bullets, it may (probably will) be important to
include a paragraph mark in the range being picked up, otherwise there's a
good chance none of the paragraph-level formatting will be included. And
Bullets are paragraph-level :)
 
D

DJohnson

Cindy,

Thanks for the information. Sorry about not getting back to you, another
project got in the way.

The bulletted text is within the paragraph that I am trying to copy.
Paragraph marks are included in the range. I tried using the FormattedText
attribute of the Range object but it does not seem to be copying any of the
formatted text. There were no special formatting characters for bulletted
text in the FormattedText attribute when I stepped through the code.

Derek
 
C

Cindy M -WordMVP-

Hi Derek,
Thanks for the information. Sorry about not getting back to you, another
project got in the way.

The bulletted text is within the paragraph that I am trying to copy.
Paragraph marks are included in the range. I tried using the FormattedText
attribute of the Range object but it does not seem to be copying any of the
formatted text. There were no special formatting characters for bulletted
text in the FormattedText attribute when I stepped through the code.
In this case, then, it's quite possible that the bulleted paragraphs haven't been
formatted with a unique style name, not present in the target document. So the style in
the target document is overwriting the formatting coming in.

If you create a style in the "source" document that contains these bullets as part of
the style definition and apply it to some paragraphs, do the bullets come across?
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in the
newsgroup and not by e-mail :)
 
Top