Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Positioning the cursor
Message
 
À
02/10/2011 16:28:38
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 5
OS:
Windows 7
Divers
Thread ID:
01525412
Message ID:
01525438
Vues:
45
>Hi All:
>
>In the following snippet:
>
>
>		loDoc = .oWord.documents.OPEN(tcDocument)
>		
>		lcText = gc_sdate8 + ' ' + alltrim(gc_userid) + ':' + chr(13) + chr(13)
>
>		loRange = loDoc.Range()
>		loRange.InsertBefore(lcText)
>		
>		.oWord.VISIBLE = .T.
>
>		.oword.WINDOWSTATE = wdWindowStateMinimize
>		.oword.WINDOWSTATE = wdWindowStateMaximize && this automatically makes the window activated
>
>
>Ths cursor is positioned BEFORE the inserted text. How do I position it AFTER the inserted text?
>
>Thanks,
>
>Yossi


Something like this?
#define wdCollapseEnd 0 
#define wdCharacter   1
oWord = CREATEOBJECT([Word.Application])

loDoc = oWord.documents.OPEN(GETFILE())
oWord.VISIBLE = .T.
lcText = gc_sdate8 + ' ' + alltrim(gc_userid) + ':' + chr(13) + chr(13)
loRange = loDoc.Range()
loRange.Collapse(wdCollapseEnd)
loRange.MoveEnd(wdCharacter, -1 )
oWord.Selection.TypeText(lcText)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform