C
Chuck
We've got a problem with external code where the external developers have
created an add in that intercepts FileSave and FileSaveAs but seems to
disable Ctrl+S to save files ONLY if users have dragged the File SaveAs
command onto a command bar.
Looking at the code in the add in, the external developers have chosen to
bind a command bar control to an object and then execute the object instead
of simply using ActiveDocument.Save or ActiveDocument.SaveAs (or object.save
or whatever).
Question -- what is the rationale for binding an object to a command bar
control (see below) instead of simply using ActiveDocument.Save or
object.Save?
Sub FileSaveBinding()
[snip]
Set objSave = Word.CommandBars("File").FindControl(ID:=3)
objSave.Execute
[snip]
End sub
Sub FileSaveAsBinding()
[snip]
Set objSaveAs = Word.CommandBars("File").FindControl(ID:=748)
objSaveAs.Execute
[snip]
End sub
Note: This is a bit of a repost from a previous thread. (There seemed to
be some confusion in the previous thread about what I was asking -- the
question we're trying to answer here is about coding practice -- why bind an
object to a command bar control and then execute the object rather than
simply using a Save/SaveAs command -- *not* about when/how to use buttons on
command bars.)
Thanks for any thoughts!
created an add in that intercepts FileSave and FileSaveAs but seems to
disable Ctrl+S to save files ONLY if users have dragged the File SaveAs
command onto a command bar.
Looking at the code in the add in, the external developers have chosen to
bind a command bar control to an object and then execute the object instead
of simply using ActiveDocument.Save or ActiveDocument.SaveAs (or object.save
or whatever).
Question -- what is the rationale for binding an object to a command bar
control (see below) instead of simply using ActiveDocument.Save or
object.Save?
Sub FileSaveBinding()
[snip]
Set objSave = Word.CommandBars("File").FindControl(ID:=3)
objSave.Execute
[snip]
End sub
Sub FileSaveAsBinding()
[snip]
Set objSaveAs = Word.CommandBars("File").FindControl(ID:=748)
objSaveAs.Execute
[snip]
End sub
Note: This is a bit of a repost from a previous thread. (There seemed to
be some confusion in the previous thread about what I was asking -- the
question we're trying to answer here is about coding practice -- why bind an
object to a command bar control and then execute the object rather than
simply using a Save/SaveAs command -- *not* about when/how to use buttons on
command bars.)
Thanks for any thoughts!