Consulting

Results 1 to 3 of 3

Thread: how to disable Open() with the Ribbon UI

  1. #1
    VBAX Regular
    Joined
    May 2009
    Posts
    28
    Location

    how to disable Open() with the Ribbon UI

    I am writing automation code that needs to work in all versions of Word from 2000 through 2007. I want to prevent the user from opening another document (new or existing) while they are editing the current one. The only way I've found is to disable the menu options. Obviously, the code that works for earlier versions doesn't work in 2007. How does one do this under automation with the Ribbon UI?

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,724
    Location
    Use the CustomUI editor to add the XML to a DOCM file

    [vba]
    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
    <
    commands>
    <
    command idMso="FileOpen"enabled="false"/>
    </
    commands>
    </
    customUI>
    [/vba]

    There might be some other ways to open a file, but this is a start

    Paul

  3. #3
    VBAX Regular
    Joined
    May 2009
    Posts
    28
    Location
    Sorry, I need to to back a step further. I don't know much about 'DOCM' or XML. Can this be done under automation even though not all workstations will have Internet access? I was hoping there might be something that temporarily disables the option... Something like
    [vba]
    oWord.CommandBars(<whatever>).Enabled = False
    [/vba]
    that works so well with earlier versions. I just can't figure out what the <whatever> options are. But perhaps they don't exist...

Posting Permissions

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