Hi,
When i instert text in a word document (oWrd:Selection():TypeText("Text to be inserted") , how is it possible to read the vertical or horizontal position in the active page ?
Thanks for your help .
Philippe
#include "FiveWin.ch"
#define wdHorizontalPositionRelativeToPage 5
#define wdVerticalPositionRelativeToPage 6
#define wdDoNotSaveChanges 0
FUNCTION MAIN()
LOCAL oWord, oDoc, oSelection, x, y
TRY
oWord := TOleAuto():New( "Word.Application" )
CATCH
oWord := NIL
END
IF oWord <> NIL
oDoc := oWord:Documents:Add()
oWord:Visible := .T.
oSelection := oWord:Selection()
oSelection:TypeText( "This is my text in Word!" )
x := oSelection:Range:Information( wdVerticalPositionRelativeToPage )
y := oSelection:Range:Information( wdHorizontalPositionRelativeToPage )
oWord:Visible := .F.
oDoc:Close( wdDoNotSaveChanges )
oWord:Quit()
MsgStop( ALLTRIM( STR( x ) ) + ", " + ALLTRIM( STR( y ) ) )
ENDIF
RETURN NIL
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 35 guests