Results 1 to 12 of 12
  1. #1
    New Lounger
    Join Date
    Oct 2007
    Location
    Scotland
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    How to prevent normal.dot save with code (Word 2003 SP2)

    I have a problem with word saving normal.dot every time word closes
    I expect the file to change every time word opens since I run various AutoExec macros for customised toolbars
    I have tried using different codes to prevent it happening and close without saving
    Examples:

    'Sub FileExit()
    'NormalTemplate.Saved = True
    'Application.Quit
    'End Sub

    'Public Sub Autoexit()
    'If NormalTemplate.Saved = False Then
    'NormalTemplate.Saved = True
    'Else
    'End If
    'End Sub

    The codes do run, I can see them using a stop command and they all appear to step through correctly but word still insist on saving as soon as it executes the "End Sub" command

    Am I doing something wrong in the codes?
    Thanks
    Mike

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How to prevent normal.dot save with code (Word 2003 SP2)

    Welcome to Woody's Lounge!

    Why don't you set

    NormalTemplate.Saved = True

    at the end of the code in the AutoExec macro? That is safer and more dependable, in my experience. I tested it just now and it worked as intended - no prompt to save changes to Normal.dot.

  3. #3
    New Lounger
    Join Date
    Oct 2007
    Location
    Scotland
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: How to prevent normal.dot save with code (Word

    Hi Hans
    Thanks for the reply - I've tried that before - and every other piece of script i can find
    But tried again as in...

    Public Sub Autoexit()
    NormalTemplate.Saved = True
    Stop
    End Sub

    At the stop I checked the properties - it's saved ok
    But as soon as it executes the end sub.... it saves
    That's what's baffling me

    I've started with a new clean normal.dot - open word, do nothing except close word and it prompts for change - save normal.dot
    That's with it completely empty
    Just to prove it is saving I added a module
    When prompted to save said no - darn - it saved it anyway

    It's like theres a permenant dirty flag set somewhere in the word settings but no idea where to look for it
    Tried all the different reg cleaners, tried "repairing" word - no change, still does it

    I'm totally stumped - any real clever guys out there that have any idea at all what i can try?
    Mike

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How to prevent normal.dot save with code (Word

    Do you have any add-ins for Word installed? Some add-ins have their own code to clear and set the Saved flag, and this might interfere.
    Try the steps in Phil Rabichow's <!post=Systematic Approach to Behavioral Problems in Word,197827>Systematic Approach to Behavioral Problems in Word<!/post>.

  5. #5
    New Lounger
    Join Date
    Oct 2007
    Location
    Scotland
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: How to prevent normal.dot save with code (Word

    Thanks Hans - followed that and here's the story...

    Cleaned all temp files etc
    Cleared out all existing normal.dots I could find (I play with vba and tend hold onto things.... errrr..."just in case")

    Ran winword.exe /a
    Word opens and closes with no prompts and no saves

    New document with field...
    The field produces...
    System Cocuments and SettingsMichaelDesktopError.doc (the saved file with the field)
    Cocuments and SettingsMichaelApplication DataMicrosoftTemplatesNormal.dot
    So no coms or add-ins there
    Closing - it sounded like a save happened - open - tick prompt for normal save warning
    Close it - and yup - there's the darn prompt again

    Off to the registry
    I've got office 11 - export and delete data key - cross fingers
    Open word - tick prompt for normal save warning - close it and..... the prompt's there (screams,wailing and gnashing of teeth)

    back into registry
    delete same key and look for anything else that's been mentioned - found add-ins key with some keys in it - exported and deleted
    deleted normal.dot - opened word - same routine - with the same darn result, it's still saving as it closes

    I'm stumped - but thanks for trying
    Regards
    Mike

  6. #6
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: How to prevent normal.dot save with code (Word

    Can you tell us what field you are putting in the document, and how you do this. If the only thing in the document is the field then you could just attach it to a post here so that we can see it.

    StuartR

  7. #7
    New Lounger
    Join Date
    Oct 2007
    Location
    Scotland
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: How to prevent normal.dot save with code (Word

    The field is "ddeauto winword system topics"
    the result when doc is closed and opened is...

    System Cocuments and SettingsMichaelDesktopError.doc
    Cocuments and SettingsMichaelApplication DataMicrosoftTemplatesNormal.dot

    Hence it looks like no add-ins are being loaded

    But i've since tried the other suggestion on Phil's page, using the vba code:
    Sub ListAddins()
    Dim MyAddin As COMAddIn
    Dim i As Integer, msg As String
    For Each MyAddin In Application.COMAddIns
    msg = msg & MyAddin.Description & " - " & MyAddin.ProgID & vbCrLf
    Next
    MsgBox msg
    End Sub
    That produces this (extracted by "debug.print Msg" from the immediate window):

    Send to Bluetooth - BtOfficeAddin.BtOfficeIntegration.1
    - SSCDLLCOM.Connect
    Microsoft Word East European Fonts Tool - WordEEFonts.ConnectSend to Bluetooth - BtOfficeAddin.BtOfficeIntegration.1
    - SSCDLLCOM.Connect
    Microsoft Word East European Fonts Tool - WordEEFonts.Connect

    So it appears that there are 2 com addins being loaded that I can't otherwise see
    I have a usb bluetooth on the PC I use for my Nokia PC suite but it's only running when I specifically want it - it's off just now. (Don't understand what that has to do with word either!)
    and I'm happy to get rid of the East European fonts add-in, but how?

    I noticed bluetooth support server and spooler sub system both running in Process explorer so i tried killing them and before they had a chance to re-start I re-ran the vba code but that still produces the same result as above - both com add-ins are still there (as was the unwanted saving)
    At this point I'm stuck!
    Mike

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How to prevent normal.dot save with code (Word

    There's a way to manage COM add-ins from within Word:
    - Select Tools | Customize...
    - Activate the Toolbars tab if necessary.
    - Select Tools in the list of Categories on the left.
    - Select COM Add-Ins in the list of Commands on the right.
    - Drag this item to the Tools menu on the menu bar, and drop it somewhere in the menu (for example below Templates and Add-Ins).
    - Close the Customize dialog.

    You can now select Tools | COM Add-Ins... to add or remove items.

    Note: adding the menu item will obviously count as a modification of Normal.dot.

  9. #9
    New Lounger
    Join Date
    Oct 2007
    Location
    Scotland
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: How to prevent normal.dot save with code (Word

    Thanks Hans - that's got rid of the East European Com but the Bluetooth one's not shown in the list

    tried the code again again and got...
    Send to Bluetooth - BtOfficeAddin.BtOfficeIntegration.1
    - SSCDLLCOM.Connect
    so that's still there - somewhere

    Oh - and the save problem's still there

    Regards
    Mike

  10. #10
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: How to prevent normal.dot save with code (Word

    You could try searching the registry for BtOfficeIntegration, then export the key that enables this add-in and delete it (please export it first so you can recover if it all goes wrong).

    StuartR

  11. #11
    New Lounger
    Join Date
    Oct 2007
    Location
    Scotland
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: How to prevent normal.dot save with code (Word

    Hi Stuart
    Removed the keys - no change to save prompt
    Ran the code and it showed "-SSCDLLCOM.Connect"

    Removed that key and IT'S FIXED! - no saves / no prompts HOORAY!

    But just to get to the bottom of things I went hunting for the references in the exported key
    [HKEY_CLASSES_ROOTSSCDLLCOM.Connect]
    @="SSCDLLCOM.Connect"
    [HKEY_CLASSES_ROOTSSCDLLCOM.ConnectClsid]
    @="{D43FD064-853B-4621-806C-88456E396998}"

    I discovered it refers to a programme "Stylelist Style Copier" which has been summarily despatched into the wide blue yonder from my PC!!
    Many, many thanks to both you and Hans for your patient help and guidance
    Kind regards
    Mike

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How to prevent normal.dot save with code (Word

    Phew! That was a tough one, I'm glad you finally cracked it!

Posting Permissions

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