Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Foxpro-server threw an exception error in xp, not 2000
Message
De
23/04/2005 11:54:03
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Foxpro-server threw an exception error in xp, not 2000
Versions des environnements
Visual FoxPro:
VFP 8
Divers
Thread ID:
01007796
Message ID:
01007796
Vues:
63
Hi everyone:

back again for more advice on automating word 97 from foxpro 8.0. i ran my program in windows 2000 and it worked fine. now i run it in xp and i notice two differences.

my program in foxpro 8.0 opens word application, creates a word document (naming it to differentiate it from other word documents opened through the same application - ie :

oWord = Createobject("word.application")
oWord.Visible = .T.
oDocument_comprom = oWord.Documents.Add
oRange = oDocument_comprom.Range()

therefore, the document reference is "oDocument_comprom".

I also reference a directory where the user opens a a specific file and call that directory "current_directory" ie:

current_directory = justpath(lcfile)

where lcfile is the name of the file opened with getfile()

Now, to my problem. when i try to save the document, the following code works perfectly in Windows 2000:

oDocument_comprom.SaveAs(current_directory + "\rom_comparison" + ".doc")

When I try to save it in Windows XP home, 2 things happen:

1. "current_directory" now stores the backslash at the end of the name, which is not how it is stored in Windows 2000 (ie xp = "c:\", 2000 = "c:")

2. when i make the change to accommodate the above change noted in #1 above, i get an error "server threw an exception".

i've tried fooling around with the saveas code and have actually made it work once under xp, but then word closed with an error message. when i tried again, i again received the "server threw an excpetion" error. other error messages with fooling around with the code have included "type mismatch".

sorry for the long-winded message here. just want to give enough info. any suggestions to fix this would be greatly appreciated!

TIA

Paul
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform