I want to search for <DAT:SIG> and insert a picture where <DAT:SIG> is.
I can do the search with:
- Code: Select all Expand view
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:
- Code: Select all Expand view
oWord:ActiveDocument:Shapes:AddPicture( cRpl, .T., .T., 1, 1, 150, 80)
I can go to a line with:
- Code: Select all Expand view
#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>.