Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to check a new doc created? (Word 2002 /XP SP3)

    We have a software Package for creating documents. Although I dont know the inside workings of this package. in a nutshell the code does the following:
    1. from the document management sever copy the file locally.
    the local file is a temp file to work with therefore
    2. from this temp file create new documents.

    My dilema is:
    when the new document is created it appears to be under Words radar, meaning I cant capture the event of the new documnet created, or being opened in Word.

    Ive used the following methods:
    The template this document is attached to Ive used the modules:
    AutoOpen
    AutoNew

    Using class events Ive used:
    Sub app_DocumentOpen
    Sub app_NewDocument
    Sub App_DocumentChange
    Sub app_WindowActivate

    And the result is it doesnt pass thru any of this code.

    My issue is how can I determine if a new document is created - as I need to run clean up code on the document. Well I actually need to run clean up code before the New document is created but I dont know how I am going to perform this? <img src=/S/doh.gif border=0 alt=doh width=15 height=15>
    Also is there a way to determine if there are changes within a certain directory
    eg the temp directory is C:TempIDD is there a way I can monitor changes in this directory. for example if a new file is copied down or created. I can then use this new file to work with.

    any ideas?
    diana

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,549
    Thanks
    3
    Thanked 149 Times in 142 Posts

    Re: How to check a new doc created? (Word 2002 /XP SP3)

    It sounds like either the template (where your macros are) is not attached to the resulting document, or macros are disabled. Have you tried putting the code into Normal.dot and including code which interrogates the file to determine whether the rest of the code is needed to run?
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to check a new doc created? (Word 2002 /XP SP3)

    Andrew - yes your right, as soon as I read your post I realised yes the code has disabled the Word macros.

    Its not my template but the 3rd party product that has disabled the macros. Hes disabled the macros so when his code creates a new document the AutoNew or AutoOpen doesnt kick off.

    Many thanks Andrew
    diana <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

Posting Permissions

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