Associate
- Joined
- 18 Oct 2002
- Posts
- 231
I'm creating a new word object from VB6:
Is there any way that I can disable the 'Save As' in Word (i.e. the menu item)? I only want user's to save to the location of the original file if opened through my app.
Edit:
I've done a little testing in VBA and found:
Does it! However it is permanent. Had to restore a backup of my normal.dot to get it back. I only want the option to not be used if working on a document opened through my app. This is all internal btw not for joe public.
The other alternative of course would be to catch the Save As event with a VBA macro and prevent it if a certain condition exists. I don't know if its possible to trap the event though with VBA.
Code:
Dim oApp As Word.Application
Dim oDoc As Word.Document
Set oApp = CreateObject("Word.Application")
Set oDoc = oApp.Documents.Open(mobjSettings.PrecedentDir & sDocument, , True, False)
Is there any way that I can disable the 'Save As' in Word (i.e. the menu item)? I only want user's to save to the location of the original file if opened through my app.
Edit:
I've done a little testing in VBA and found:
Code:
Dim controlview As CommandBarControl
Set controlview = CommandBars.ActiveMenuBar.Controls.Item("File")
controlview.CommandBar.Controls("Save &As...").Delete
The other alternative of course would be to catch the Save As event with a VBA macro and prevent it if a certain condition exists. I don't know if its possible to trap the event though with VBA.
Last edited: