Hi,
The organization I worked for would like stop users create nested tables.
Can this be done with VBA code? Any suggestions will be greatly appreciated.
Ken

Re: How to stop users create nested tables? Possible by strazz

strazz
Sat Aug 09 18:41:02 CDT 2003

Hi Ken,

You need to create a macro with the same name as the insert table
function "not sure of the exact name).

in that macro you can use selection.information to determine if the
cursor is in a table. If it is display a message and quit. If it
isn't then you can go on and execute the insert table dialog.

Cheers
TonyS.

"Ken Wan" <kenxywan@yahoo.com.au> wrote in message news:<bh2ar0$27c7$1@otis.netspace.net.au>...
> Hi,
> The organization I worked for would like stop users create nested tables.
> Can this be done with VBA code? Any suggestions will be greatly appreciated.
> Ken

Re: How to stop users create nested tables? Possible by Cindy

Cindy
Sun Aug 10 10:42:20 CDT 2003

Hi Tony,

> You need to create a macro with the same name as the insert table
> function "not sure of the exact name).
>
Have you found any way to intercept the toolbar button? I've never
been able to catch that with an InsertTable macro...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan 24
2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :-)


Re: How to stop users create nested tables? Possible by martinique

martinique
Sun Aug 10 17:17:43 CDT 2003

Replace it with another button with the same icon, pointing to your macro.



"Cindy Meister -WordMVP-" <CindyMeister@swissonline.ch> wrote in message
news:VA.00008064.00bf5e6a@speedy...
> Hi Tony,
>
> > You need to create a macro with the same name as the insert table
> > function "not sure of the exact name).
> >
> Have you found any way to intercept the toolbar button? I've never
> been able to catch that with an InsertTable macro...
>
> Cindy Meister
> INTER-Solutions, Switzerland
> http://homepage.swissonline.ch/cindymeister (last update Jan 24
> 2003)
> http://www.mvps.org/word
>
> This reply is posted in the Newsgroup; please post any follow
> question or reply in the newsgroup and not by e-mail :-)
>



Re: How to stop users create nested tables? Possible by martinique

martinique
Sun Aug 10 18:49:49 CDT 2003

Most of the built-in Word commands are the same as the
menu_name+menu_caption: in this case TableInsertTable. (And in this case, a
macro of that name will trap the toolbar button also)

You can see the full list of Word commands by going to Tools > Macros and
selecting Word Commands from the Macros In drop-down.

May I ask WHY you want to prevent nested tables? I know of one organization
doing the opposite: trying to encourage them as an alternative to merged and
split cells, because it simplifies processing for HTML conversion.



"Ken Wan" <kenxywan@yahoo.com.au> wrote in message
news:bh6l3i$mq9$1@otis.netspace.net.au...
> Hi, Tony,
> Thanks for your suggestion. But how can I find out the Word function for
> inserting tables? Did you do similar coding before?
> Thanks in advance for your help.
> Ken
> "Tony Strazzeri" <strazz@my-Deja.com> wrote in message
> news:b1382a7c.0308091541.29521636@posting.google.com...
> > Hi Ken,
> >
> > You need to create a macro with the same name as the insert table
> > function "not sure of the exact name).
> >
> > in that macro you can use selection.information to determine if the
> > cursor is in a table. If it is display a message and quit. If it
> > isn't then you can go on and execute the insert table dialog.
> >
> > Cheers
> > TonyS.
> >
> > "Ken Wan" <kenxywan@yahoo.com.au> wrote in message
> news:<bh2ar0$27c7$1@otis.netspace.net.au>...
> > > Hi,
> > > The organization I worked for would like stop users create nested
> tables.
> > > Can this be done with VBA code? Any suggestions will be greatly
> appreciated.
> > > Ken
>
>



Re: How to stop users create nested tables? Possible by Ken

Ken
Mon Aug 11 01:07:43 CDT 2003

Hi, Martinique,
Thanks for you help. The reason for preventing users to use nested tables is
that we need to convert the word documents into messages of some fairly old
messaging standard. These messages do not support complicated tables.
Regards,
Ken
"martinique" <bedbugs@thewhitehouse.com> wrote in message
news:#bXuCo5XDHA.3232@tk2msftngp13.phx.gbl...
> Most of the built-in Word commands are the same as the
> menu_name+menu_caption: in this case TableInsertTable. (And in this case,
a
> macro of that name will trap the toolbar button also)
>
> You can see the full list of Word commands by going to Tools > Macros and
> selecting Word Commands from the Macros In drop-down.
>
> May I ask WHY you want to prevent nested tables? I know of one
organization
> doing the opposite: trying to encourage them as an alternative to merged
and
> split cells, because it simplifies processing for HTML conversion.
>
>
>
> "Ken Wan" <kenxywan@yahoo.com.au> wrote in message
> news:bh6l3i$mq9$1@otis.netspace.net.au...
> > Hi, Tony,
> > Thanks for your suggestion. But how can I find out the Word function for
> > inserting tables? Did you do similar coding before?
> > Thanks in advance for your help.
> > Ken
> > "Tony Strazzeri" <strazz@my-Deja.com> wrote in message
> > news:b1382a7c.0308091541.29521636@posting.google.com...
> > > Hi Ken,
> > >
> > > You need to create a macro with the same name as the insert table
> > > function "not sure of the exact name).
> > >
> > > in that macro you can use selection.information to determine if the
> > > cursor is in a table. If it is display a message and quit. If it
> > > isn't then you can go on and execute the insert table dialog.
> > >
> > > Cheers
> > > TonyS.
> > >
> > > "Ken Wan" <kenxywan@yahoo.com.au> wrote in message
> > news:<bh2ar0$27c7$1@otis.netspace.net.au>...
> > > > Hi,
> > > > The organization I worked for would like stop users create nested
> > tables.
> > > > Can this be done with VBA code? Any suggestions will be greatly
> > appreciated.
> > > > Ken
> >
> >
>
>



Re: How to stop users create nested tables? Possible by martinique

martinique
Mon Aug 11 01:37:25 CDT 2003

Fair enough. Watch for merged and split cells. They're a bugger to deal with
also.



"Ken Wan" <kenxywan@yahoo.com.au> wrote in message
news:bh7bie$1ar5$1@otis.netspace.net.au...
> Hi, Martinique,
> Thanks for you help. The reason for preventing users to use nested tables
is
> that we need to convert the word documents into messages of some fairly
old
> messaging standard. These messages do not support complicated tables.
> Regards,
> Ken
> "martinique" <bedbugs@thewhitehouse.com> wrote in message
> news:#bXuCo5XDHA.3232@tk2msftngp13.phx.gbl...
> > Most of the built-in Word commands are the same as the
> > menu_name+menu_caption: in this case TableInsertTable. (And in this
case,
> a
> > macro of that name will trap the toolbar button also)
> >
> > You can see the full list of Word commands by going to Tools > Macros
and
> > selecting Word Commands from the Macros In drop-down.
> >
> > May I ask WHY you want to prevent nested tables? I know of one
> organization
> > doing the opposite: trying to encourage them as an alternative to merged
> and
> > split cells, because it simplifies processing for HTML conversion.
> >
> >
> >
> > "Ken Wan" <kenxywan@yahoo.com.au> wrote in message
> > news:bh6l3i$mq9$1@otis.netspace.net.au...
> > > Hi, Tony,
> > > Thanks for your suggestion. But how can I find out the Word function
for
> > > inserting tables? Did you do similar coding before?
> > > Thanks in advance for your help.
> > > Ken
> > > "Tony Strazzeri" <strazz@my-Deja.com> wrote in message
> > > news:b1382a7c.0308091541.29521636@posting.google.com...
> > > > Hi Ken,
> > > >
> > > > You need to create a macro with the same name as the insert table
> > > > function "not sure of the exact name).
> > > >
> > > > in that macro you can use selection.information to determine if the
> > > > cursor is in a table. If it is display a message and quit. If it
> > > > isn't then you can go on and execute the insert table dialog.
> > > >
> > > > Cheers
> > > > TonyS.
> > > >
> > > > "Ken Wan" <kenxywan@yahoo.com.au> wrote in message
> > > news:<bh2ar0$27c7$1@otis.netspace.net.au>...
> > > > > Hi,
> > > > > The organization I worked for would like stop users create nested
> > > tables.
> > > > > Can this be done with VBA code? Any suggestions will be greatly
> > > appreciated.
> > > > > Ken
> > >
> > >
> >
> >
>
>



Re: How to stop users create nested tables? Possible by strazz

strazz
Mon Aug 11 04:51:53 CDT 2003

Good point Cindy,

I was only working off theory. I hadn't realised that this little
beastie was different.

I guess you could replace the toolbar button with one pointing to the
macro, as another respondent suggested, but I am sure you probably
already know this.

I will now indulge in a little S&M <g>

Cheers
TonyS.


Cindy Meister -WordMVP- <CindyMeister@swissonline.ch> wrote in message news:<VA.00008064.00bf5e6a@speedy>...
> Hi Tony,
>
> > You need to create a macro with the same name as the insert table
> > function "not sure of the exact name).
> >
> Have you found any way to intercept the toolbar button? I've never
> been able to catch that with an InsertTable macro...
>
> Cindy Meister
> INTER-Solutions, Switzerland
> http://homepage.swissonline.ch/cindymeister (last update Jan 24
> 2003)
> http://www.mvps.org/word
>
> This reply is posted in the Newsgroup; please post any follow
> question or reply in the newsgroup and not by e-mail :-)

Re: How to stop users create nested tables? Possible by Tony

Tony
Mon Aug 11 06:26:43 CDT 2003

As Martinique pointed out, the macro name to use is
TableInsertTable.

When I looked at the Word Command list, TableInsertTable
does not appear. What appears is InsertTableGeneral. But
when I select InsertTableGeneral, the Run button stays
greyed out.

If I assign a shortcut key to InsertTableGeneral it will
run and if I have a macro by the same name that will run
instead.

Curiously, TableInsertTable has a wdDialog constant for
use with the dialogs collection.

I initially looked at what was being run by the Insert
table menu without success. I compared its settings with
that of Format Paragraph (which also launches a dialog
box). I couldn't see any significant difference.
Curiously neither had a "onAction" setting. So I simply
set the onAction for the table menu using
Dim ctl As CommandBarButton
Set ctl = Application.CommandBars("Menu Bar").Controls
("T&able").Controls("&Insert").Controls("&Table...")
ctl.OnAction = "TableInsertGeneral"

Cheers
TonyS.

>-----Original Message-----
>Good point Cindy,
>
>I was only working off theory. I hadn't realised that
this little
>beastie was different.
>
>I guess you could replace the toolbar button with one
pointing to the
>macro, as another respondent suggested, but I am sure you
probably
>already know this.
>
>I will now indulge in a little S&M <g>
>
>Cheers
>TonyS.
>
>
>Cindy Meister -WordMVP- <CindyMeister@swissonline.ch>
wrote in message news:<VA.00008064.00bf5e6a@speedy>...
>> Hi Tony,
>>
>> > You need to create a macro with the same name as the
insert table
>> > function "not sure of the exact name).
>> >
>> Have you found any way to intercept the toolbar button?
I've never
>> been able to catch that with an InsertTable macro...
>>
>> Cindy Meister
>> INTER-Solutions, Switzerland
>> http://homepage.swissonline.ch/cindymeister (last
update Jan 24
>> 2003)
>> http://www.mvps.org/word
>>
>> This reply is posted in the Newsgroup; please post any
follow
>> question or reply in the newsgroup and not by e-mail :-)
>.
>