Results 1 to 4 of 4

Thread: Word Macros

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    69

    Unhappy

    Hi, I have a problem with a word template. When the template loads a form pops up that allows the user to fill out some fields (this is for a fax) then they click O.K. and the Fax template is populated with the information for the form. the problem is when you use the template again, with the first template still open, it will try to populate the info over the CURRENT doc instead of opening up a new one. Any Ideas?

  2. #2
    Junior Member
    Join Date
    Aug 2000
    Location
    Girona
    Posts
    18

    Question

    With Word there are a lot of problems to know what document in the document collection is the document that you are referencing.

    Few time ago i have a similar problem like this and after trying a lot of Word options the only solution was close the document before opening a new one. But you can try this:

    Dim wDoc as Word.Document
    Dim wApp as Word.Application

    Set wApp=New Word.Application

    set wDoc=wApp.Documents.Add([Name of your template],False)

    And the object wDoc have the reference to the document you need.

  3. #3
    Addicted Member
    Join Date
    Sep 2000
    Posts
    219
    I am sorry I did not understand the problem earlier.

    Why don't you use Word.ActiveDocument to do the job? ActiveDocument can be used to control the new document created from the template.

    To see what I mean, place this code in the New event of a new document template, and create a new file from the template.

    msgbox Word.ActiveDocument.Name

    A message will appear showing the name of the new document.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    69

    Cool

    This will work! Thank you! Thank you very much!

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