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
 
Top