Results 1 to 4 of 4
  1. #1
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Multiple document & forms/customs properties (WORD2000)

    Hi Robie

    The reason it worked in Word 97 but not in Word 2000 is that Word 2000 opens new documents as a separate task (so you can Alt-Tab between documents). Word 97 on the other hand opens documents inside the same application.

    To get around this problem, you need to change the code so that you refer directly to documents rather than ActiveDocument (because you can have more than one active now)
    An example of the lines of code you might use are below.
    Dim doc1 as Document, doc2 as Document
    Set doc1 = ActiveDocument
    Set doc2 = Documents.Add 'create a new document and add reference to it at same time

    Once you have defined the documents, use doc1 and doc2 in the place of ActiveDocument
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Multiple document & forms/customs properties (WORD2000)

    I'm not sure I understand these two lines. Does either of them work correctly in your scenario? What is the parameter that is being passed on the second line? Could it be pointing to the wrong document?

    I_AddDocVariables ' Add active doc variables for use
    I_InitialiseAndDisplayDocPropeties (fNewDocument) ' Initialise & display doc properties

  3. #3
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    London, Gtr London, England
    Posts
    416
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Multiple document & forms/customs properties (WORD2000)

    Sorry, I have complicated matter more than I should have. Just to answer your question - yes those two lines work correctly and all they do is create/add document variables and intialise userform variables. Nothing complex in those two functions.

    The other thing I have noticed is that, if I create a new document and save it (i.e. it is still on screen - all I have done is saved it NOT closed it). And then create a new, it DOESN'T switch to the saved document. Everything works as expected and correctly. This perhaps tells me I may somehow contributing to this swich of the document prior to updating the custom document properties.

    I will look bit more into it.

    Robie
    Thanks.
    Robie

  4. #4
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    London, Gtr London, England
    Posts
    416
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Multiple document & forms/customs properties (WORD2000)

    Post deleted by robie

    Sorry, deleted by mistake. I was trying to get rid the whole post as I have now solved my problem. It was to do with intialising the userform in once instance and NOT unloading it.

    Thanks for inputs Andrew and JScher.
    Thanks.
    Robie

Posting Permissions

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