Quantcast
Channel: Adobe Community: Message List - FrameMaker Scripting
Viewing all articles
Browse latest Browse all 3715

Re: Best way to copy range of paragraphs

$
0
0

Hi Mark,

 

Your thinking is right, but a couple of details are important:

 

1. Setting the TextRange

 

Create two TextLoc objects, one pointing at your first Pgf with offset 0, the second one pointing at the lasst Pgf in your section, with offset Constants.FV_OBJ_END_OFFSET. Then create the TextRange object, using the start and finish TextLoc objects.

 

2. Copying the TextRange

 

Set the TextSelection property of the Document to the TextRange you created. Then use the Copy method on the Document. The Copy method does not take arguments, it always takes the current TextSelection.

 

3. Pasting the materials

 

In the target document, set the text cursor by creating a TextRange with the same beg and end TextLoc objects (pointing at the point where you want to insert the text. Then set the TextSelection of the target Document to the new TextRange. Use the Paste method with the right flags you need (see page 482-483 of the FrameMaker 10 Scripting Guide.

 

Another method would be to make all text without change bars hidden, but that would take a little more time and effort to explain.

 

I hope this helps.

 

Jang


Viewing all articles
Browse latest Browse all 3715

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>