Ive following problem:
I have a COM AddIn for Word, developped in VB .NET. Within this AddIn some documents can be opened. To those documents the menu "Save as" (in Word) shall be disabled. For the other documents it should be enabled.
This is how I do it:
Thats working fine.
Now I want to save and close this document. (Its saved automatically when the user closes it; therefore Im using the DocumentBeforeClose event). During this procedure I am sometimes asked, if I want to save the document.
Just in the beginning of my DocumentBeforeClose I set the enabled-property to true again.
Any idea what may be wrong?
I have a COM AddIn for Word, developped in VB .NET. Within this AddIn some documents can be opened. To those documents the menu "Save as" (in Word) shall be disabled. For the other documents it should be enabled.
This is how I do it:
Code:
Dim objWord As Word.Application
objWord = CType(objWordInstance, Word.Application)
objWord.CustomizationContext = objWord.ActiveDocument
objWord.CommandBars(cstrMenuBar).Controls(cstrMenuDatei).controls(cstrMenuSaveAs).enabled = False
Thats working fine.
Now I want to save and close this document. (Its saved automatically when the user closes it; therefore Im using the DocumentBeforeClose event). During this procedure I am sometimes asked, if I want to save the document.
Just in the beginning of my DocumentBeforeClose I set the enabled-property to true again.
Any idea what may be wrong?