Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I've 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:

Dim objWord As Word.Application
objWord = CType(objWordInstance, Word.Application)
objWord.CustomizationContext = objWord.ActiveDocument
objWord.CommandBars(cstrMenuBar).Controls(cstrMenuDatei).controls(cstrMenuSaveAs).enabled = False

 

That's working fine.

 

Now I want to save and close this document. (It's saved automatically when the user closes it; therefore I'm 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?

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...