S
shawn
Hi all,
I use this forum extensively but this is the first time I am posting
so I hope it goes well!
I have a document management application and for this Word is required
to track all changes. However, Word does not track changes when you
delete an entire column from a table, and in fact gives you a message
box saying such. So I would like to disable the option to delete a
column all together. I have a template which has several funcitons and
subs, so in it I have a sub to set menu options when a document is
opened. So far I am able to disable the option on the main
menu with the following simple code:
Sub SetMenuOptions(ByRef aBoolSet As Boolean)
Dim curMenu, lControl, lItem, lOptions
Dim lSelection
'new requirement for XP - Remove the delete cell menu option
Set curMenu = CommandBars.ActiveMenuBar.Controls
Set lControl = curMenu("Table")
Set lItem = lControl.Controls("Delete")
For Each lOptions In lItem.Controls
If lOptions.ID = 292 Or lOptions.ID = 294 Then
lOptions.Visible = aBoolSet
End If
Next
End Sub
THE PROBLEM:
The option to delete a column is available when you select an entire
column and right click. How can I access that right click menu
programmatically? I'm pretty good with word programming and VBA in
general but I haven't been able to figure this out for a long time.
Anyone have a similar experience or any thoughts???
BTW: this is Word XP but the same would hold true in 2000.
Thanks!
Shawn
I use this forum extensively but this is the first time I am posting
so I hope it goes well!
I have a document management application and for this Word is required
to track all changes. However, Word does not track changes when you
delete an entire column from a table, and in fact gives you a message
box saying such. So I would like to disable the option to delete a
column all together. I have a template which has several funcitons and
subs, so in it I have a sub to set menu options when a document is
opened. So far I am able to disable the option on the main
menu with the following simple code:
Sub SetMenuOptions(ByRef aBoolSet As Boolean)
Dim curMenu, lControl, lItem, lOptions
Dim lSelection
'new requirement for XP - Remove the delete cell menu option
Set curMenu = CommandBars.ActiveMenuBar.Controls
Set lControl = curMenu("Table")
Set lItem = lControl.Controls("Delete")
For Each lOptions In lItem.Controls
If lOptions.ID = 292 Or lOptions.ID = 294 Then
lOptions.Visible = aBoolSet
End If
Next
End Sub
THE PROBLEM:
The option to delete a column is available when you select an entire
column and right click. How can I access that right click menu
programmatically? I'm pretty good with word programming and VBA in
general but I haven't been able to figure this out for a long time.
Anyone have a similar experience or any thoughts???
BTW: this is Word XP but the same would hold true in 2000.
Thanks!
Shawn