Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is the best way to initalize Word97 from VFP6?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00156542
Message ID:
00157839
Vues:
98
Juan,

The VFP form where my Word stuff is running from contains no other ActiveX controls, just a single VFP CommandButton for Printing the document after it's built. I wonder if you put the test Word code in a simple empty VFP form and tried it?

Does oDoc come back as an Object as far as VFP is concerned? If you try and Open() a .doc/.dot that doesn't exist or isn't in the current directory you'll get an error. I use code like this:
   local lcFile
   lcFile = fullpath( curdir() ) + "work order.dot"
   this.moWorkOrder = .Documents.Add( (lcFile) )
   if ( ! IsObject( this.moWorkOrder ) )
      MessageBox( "File " + lcFile + " can not be found." + chr(13) + chr(13) + ;
                  "The work order may not have the proper formatting.", ;
                  MB_ICONEXCLAMATION, _screen.Caption )
      this.moWorkOrder = .Documents.Add()
      if ( ! IsObject( this.moWorkOrder ) )
         MessageBox( "Document can not be created", MB_ICONSTOP, _screen.Caption )
         this.SetStatus( "Failed" )
         return .f.
      endif
   endif
My error method sometimes catches errors like this:

---19981009 13:50:52 WordHelper: 1426 destroy OLE error code 0x800706ba: The RPC server is unavailable.
---19981009 14:37:36 WordHelper: 1426 destroy OLE error code 0x80010108: The object invoked has disconnected from its clients.

I haven't completely got the cause of it tracked down, but they are non-fatal errors.

>Saturday, I spent most of my day at work trying to figure out this problem. I installed my application in two NT PCs with no luck. I also, tried installing the app in my WIN98 laptop at home. No luck either. However, this time I was getting either an "ACTIVEDOCUMENT does not evaluate to an object" or "OLE server threw an exception error".
>
>I was supposed to had handed my client this "Billing System" today, however, as you can image, that will not happen.
>
>I trully believe that this is an issue with VFP 6.0. I use VB 6.0 and the way I obtain the VBA equivalent code is by recording Word macros, editing them and extracting the code. I then translate that code into VFP code.
>
>I have been doing work with VB for about 5 years, and xBase and VFP since dBase II.
>
>When I first created my Word97 document creation code, I had it on a stand alone form and all calls were in a procedure file. At that time, I had no problem whats so ever except for an occassional "OLE server threw an exception error". Now, I have incorporated these call within one form that contains the following other OLE objects:
>
>Microsoft Tree View Ver. 6.0
>Microsoft ImageList Ver. 6.0
>Microsoft ListView Ver. 6.0
>Microsoft Status Bar Ver. 6.0
>
>The only thing that I can think of trying next is to place all of those Word97 OLE calls in a class, just the way you did it.
>
>I don't know what else to try at this point. However, I can not believe that I am the only one in the VFP 6.0 to have experienced these Word97 interaction problems.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform