Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Tables / October 2004

Tip: Looking for answers? Try searching our database.

Disable the ability to delete columns from a table in word Word XP/2000 !!!!!HELP!!!!!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shawn - 05 Oct 2004 20:26 GMT
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
Doug Robbins - 06 Oct 2004 01:39 GMT
Create a macro

TableDeleteColumn()
   MsgBox "No you don't"
End Sub

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

> Hi all,
> I use this forum extensively but this is the first time I am posting
[quoted text clipped - 34 lines]
> Thanks!
> Shawn
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.