How Can I Get Paragraph Number

M

Mukesh Gajjar

Hi,

How Can I Get The Paragraph Number, Currently I Am Using Code Below,

Var
FServer: _Application;

Function GetCpParNr: Integer;
Var
iCount: Integer;
iPara: Integer;
Begin
iPara := 0;
For iCount := 1 To (FServer.ActiveDocument.Paragraphs.Count) Do Begin
If FServer.Selection.InRange(FServer.ActiveDocument.Paragraphs.Item(iCount).Range)
Then Begin
iPara := iCount;
Break;
End;
End;
Result := iPara;
End;

But The Execution Of This Code Is Very Slow With 500 And More Pages
Document,
Can Anyone Tell Me Any Alaternative Of This Problem?

Thanks,
Mukesh Gajjar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top