Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Interface with MS Word
Message
De
26/03/1999 10:11:46
 
 
À
26/03/1999 10:03:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00202346
Message ID:
00202356
Vues:
13
>I did setup a worrd template with bookmarks and wnat to jump to them in VFP and insert text to it like:
>
>with oWord
> .Documents.Add ("C:\WINDOWS\Application Data\Microsoft\Templates\Collect1.dot", .F.,0)
> .ActiveDocument.SaveAs("a.doc" )
> .Selection.GoTo("toName" )
> .Selection.TypeText("ERGERGERGERGERGERGERG")
> .Visible=.t.
>endwith
>
>but this gives me an OLE error.
>How can I implement jumping to bookmarks??
>
>Peter

Hi Peter,

Your problem is with the parameters since VBA uses named parameters. Try something like this

HTH,

Ken


WITH oWord
.DOCUMENTS.OPEN(lcTemplate)
.ACTIVEDOCUMENT.SAVEAS(lcOutPut)
.SELECTION.GOTO(wdGoToBookmark,,,'DATEBOOKED')
.SELECTION.TYPETEXT(lcDate)
.SELECTION.GOTO(wdGoToBookmark,,,'CONTACTNAME')
.SELECTION.TYPETEXT(lcContact)
.SELECTION.GOTO(wdGoToBookmark,,,'CONTACTCLIENT')
.SELECTION.TYPETEXT(lcClient)
.SELECTION.GOTO(wdGoToBookmark,,,'CONTACTADDRESS')
.SELECTION.TYPETEXT(lcContAddr)
.SELECTION.GOTO(wdGoToBookmark,,,'CONTACTDEAR')
.SELECTION.TYPETEXT(lcContDear)
.SELECTION.GOTO(wdGoToBookmark,,,'CLIENTNAME')
.SELECTION.TYPETEXT(lcClient)
.ACTIVEDOCUMENT.CLOSE(.T.)
ENDWITH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform