Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Jan 2004
    Location
    Ulaan Baatar
    Posts
    518
    Thanks
    1
    Thanked 42 Times in 40 Posts
    Word 2003

    I have the dreaded "normal.dot is always saved when Word is closed" disease !

    I have tried everything I can find to stop this - add-ins, settings etc etc but it persists. I think it is a remnant of the uninstallation of a pdf add-in.

    Anyway, it disrupts synchronisation between 2 PCs (long story) and I would like to take a sledge-hammer approach rather than spending any more time in diagnosis as I really don't want any changes made to normal.dot by this machine.

    I have been trying to write an auto-close sub in VBA but cannot find the correct syntax - any help gratefully received.

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    4 Star Lounger
    Join Date
    Jan 2004
    Location
    Ulaan Baatar
    Posts
    518
    Thanks
    1
    Thanked 42 Times in 40 Posts
    Should have said I got as far as this:

    Private Sub Auto_Exit()
    NormalTemplate.Saved (True)
    End Sub

    Curiously, after writing this and closing Word, normal is NOT saved (good) but the next time I open and close Word normal IS saved (bad).

    How can I make this take effect every time I exit from Word ?

    Thanks

  4. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by MartinM View Post
    Should have said I got as far as this:

    Private Sub Auto_Exit()
    NormalTemplate.Saved (True)
    End Sub
    To make that work, I think you need these revisions (however, I have not tested it):

    Code:
    Sub AutoExit()
    ' Flag Normal.dot as saved so Word does not prompt to save it again
    NormalTemplate.Saved = True
    End Sub
    == Edit ==

    After a quick search, it appears that some people place this code in an AutoClose macro, saying that Word prompts to save Normal.dot before the AutoExit macro runs. This would mean that if you make any changes to Normal.dot (e.g., add an AutoText entry, a formatted AutoCorrect entry, or change a style in Normal.dot), you will need to save it manually before you close any documents.

  5. #4
    4 Star Lounger
    Join Date
    Jan 2004
    Location
    Ulaan Baatar
    Posts
    518
    Thanks
    1
    Thanked 42 Times in 40 Posts
    Thanks - you were right, it had to be AutoClose

    Sub AutoClose()
    ' Flag Normal.dot as saved so Word does not prompt to save it again
    NormalTemplate.Saved = True
    End Sub

    Now to add an if statement so it only does this on the delinquent PC, and I can edit normal.dot on the others without going though hoops :-)

  6. #5
    4 Star Lounger
    Join Date
    Jan 2004
    Location
    Ulaan Baatar
    Posts
    518
    Thanks
    1
    Thanked 42 Times in 40 Posts
    So here is the whole thing, working exactly as needed- the saving of normal.dot is suppressed on PCs where the named file exists - again my thanks:

    Public Function FileExists(Fname As String) As Boolean

    If Fname = "" Or Right(Fname, 1) = "\" Then
    FileExists = False: Exit Function
    End If

    FileExists = (Dir(Fname) <> "")

    End Function

    Sub AutoClose()

    ' Flag Normal.dot as saved so Word does not prompt to save it again
    ' As long as the named file exists

    If FileExists("filename.xxx") Then NormalTemplate.Saved = True

    End Sub

  7. #6
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,868
    Thanks
    0
    Thanked 179 Times in 165 Posts
    Seems to me it would be a whole lot simpler to mark the file as read-only, via Windows Explorer.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Posting Permissions

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