Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Work with only one Instance of Word
Message
 
À
21/05/2002 08:29:06
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00658782
Message ID:
00661405
Vues:
24
>Is there a reason you can't just store your reference to Word somewhere and check it when you need a reference. I usually use a property of the form or object I'm working with and store my Word reference there. Create it the first time I need and, typically, close it on the way out.
>
>Tamar

I'm not sure what you mean by store a reference to Word using a Property of my form. I was going to using the following code in the click of my cmdButton:
  IF !CheckServer("Word.Application")
	MESSAGEBOX("Microsoft Word not properly installed on this system.")
	RETURN .F.
  ENDIF
  IF VARTYPE(oWord) <> "O"
	RELEASE oWord
	PUBLIC oWord
	oWord = CREATEOBJECT("Word.Application")
  ENDIF
  oDoc = GetObject(ThisForm.cPcbLetter, "Word.Document")
  IF oWord.Visible <> .T.
	oWord.Visible = .T.
  ENDIF
But the more I get into it, the more questions I am coming up with. Like for instance how do you handle the case where Word, or any of the other servers for that matter, is already running outside of your application? I think I am going to rethink to code above, as I have skipped ahead in your book and started reading Chapter 15 "Wrapping Up The Servers". I think I will incoporate those classes into my application.

And pardon me if my question on the "servers already running outside the application" is answered in there. I guess I hadn't got to that part yet.

Thank you.
Elgin Rogers
Epic Solutions
www.epicsolutions.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform