Results 1 to 3 of 3

Thread: DLL question....

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 1999
    Location
    Princeton, New Jersey
    Posts
    46

    Post

    I am trying to write a COM Object that has functions to create a "Word.Application" object, write and format some data in the document and then save the document.

    This dll will be registered and run on my Personal Web Server from which I will access the COM object via script.

    My question is, in the dll, how do I declare or create the object .... Set appWD = CreateObject ("Word.Application")
    .... so that It is available to ALL other functions?

    (I need to be able to close the instance of Word from script by calling a method on the COM object that in turn kills the Word.Application object)

    Thanks, Sorry this is so wordy.

  2. #2
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    355

    Post

    well, this method should work:

    in declarations:

    Public appWd as new Word.Application

    im not sure this will work,but try it

    ------------------
    cintel rules
    www.cintelsoftware.co.uk

  3. #3
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Kenny is correct. If you only have a single class, put it in the general/declarations. In the Class_Initialize, instantiate the object. In the class_terminate, destroy the object. These methods do not apply if your component will run in MTS: You'll have to do it all within one function

    FYI: This will not be a scalable solution because of the large overhead required to instantiate the word object....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width