Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with Word automation
Message
De
11/12/2003 02:41:01
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
10/12/2003 13:37:32
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00857378
Message ID:
00857988
Vues:
26
>Cetin,
>
>you certainly illuminated the problem!!
>
>Trying the add actually did create a connection object that returned the name (Document1).
>
>That means the oDocument.GetObject("C;\My Documents\I247a.doc") is not really working as it should although it does return an object.
>
>Tried oWord.Documents.open("C:\My Documents\I247a.doc") also and that doesn't work. So I'm stuck with a loading issue. Changed directories to avoid blank spaces (put it in a directory called "Downloads" and still no go. Can work on the document in word and save and everything but not load via automation. Wish you had a solution for that!!
>
>Thanks,
>
>Steve

Steve,
I mainly suspected of a faulty doc. I have no explanation if that does open manually using word but not through automation (would suspect passwords but doesn't seem likely in your case).
One suggestion, do not use GetObject() but oWord=CreateObject(...). There are 2 styles using GetObject() :
GetObject(lcDoc) and GetObject(,lcDoc). First one returns a document object if succesfull where the latter a word object with doc opened in it (when there is another instance running). I won't go into details of why but do not use both of them (accept personal thought, experience).
PS: I assume code samples you said you tried were written here in your msgs with typos and actual code is error free (syntax wise:).
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
Répondre
Fil
Voir

Click here to load this message in the networking platform