Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with Word automation
Message
De
10/12/2003 11:30:29
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
09/12/2003 15:38:43
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00857378
Message ID:
00857710
Vues:
19
>All,
>
>I'm trying some office automation using word 2000 and VFP7. Been following the book "Office Automation with Visual Foxpro" but not having much luck.
>(I have had success working with Excel and Access). 'oWord = CreateObject("Word.Application")' works ok as does 'oDocument = oWord.document.open("name of document")' and certainly 'oWord.Application.Visable = .T.'. I have the document displayed in word. oDocument is created as an object called oDocument with no properties/methods - just the object. And that's as far as it goes. oDocument returns nothing but ole errors. Even the simplest ? "oDocument.Name" gives an ole error - "OLE error code 0x800a8029 Unknown COM status code."
>
>What might be going on?? I would blame it on my install of WIN2000/Office2000 except I have another machine with Word 97/Win2000 and it does the same thing. Anybody got some suggestions as to what I may be doing wrong??
>
>Steve
? "oDocument.Name" 
Is this really the code you're trying or a typo ?
This little sample works wonderfully well for me :
Local oWord as "Word.Application", lcDoc as String, oDoc as "Word.Document"
lcDoc = GetFile('doc')
oWord = CREATEOBJECT("Word.Application")
oDoc = oWord.documents.open(lcDoc)
? oDoc.Name
oWord.visible= .T.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform