Is there a way to get a line number for a given text string?
I want to search for <DAT:SIG> and insert a picture where <DAT:SIG> is.
I can do the search with:
And can insert the picture with:
I can go to a line with:
I just need to know how to get the right value for nLineNumber based on the location of <DAT:SIG>.
I want to search for <DAT:SIG> and insert a picture where <DAT:SIG> is.
I can do the search with:
FUNCTION WordPicture( oSel, cSrc, cRpl, oWord )
LOCAL oRng := oSel:Document:Content
oRng:Find:MatchWildcards:= .t.
IF AT( cSrc, oRng:Text ) = 0; RETURN .F.; ENDIF
WHILE oRng:Find:Execute( cSrc )
oRng:Text = ""
oRng:Collapse( wdCollapseEnd )
ENDDO
RETURN .T.And can insert the picture with:
oWord:ActiveDocument:Shapes:AddPicture( cRpl, .T., .T., 1, 1, 150, 80)I can go to a line with:
#define wdGoToAbsolute 1
#define wdGoToLine 3
oword:selection:goto(wdGoToLine, wdGoToAbsolute, nLineNumber)I just need to know how to get the right value for nLineNumber based on the location of <DAT:SIG>.
Thanks,
Jeff Barnes
(FWH 16.11, xHarbour 1.2.3, Bcc730)
Jeff Barnes
(FWH 16.11, xHarbour 1.2.3, Bcc730)

