Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Interface with MS Word
Message
From
26/03/1999 10:11:46
 
 
To
26/03/1999 10:03:08
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00202346
Message ID:
00202356
Views:
14
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform