Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
Jeff Ditty
 
Posts: n/a
Default Change Table Background Macro

Hello-

I am trying to write a macro that will execute when a user selects a
checkbox. When the box is selected, I want the macro to select the table
that contains the checkbox and change the background color of the table. I
can get the checkbox to execute, but when I try to select the table it gives
me a runtime error "4065....command is not available". It appears that is
cannot find the table I am referring to....

I am selecting the table and changing the background using the following:

ActiveDocument.Tables(4).Shading .BackgroundPatternColor = wdColorGray50

Anyone have any ideas why it is not finding the table?

Thanks,

Jeff


  #2   Report Post  
Posted to microsoft.public.word.tables
Jezebel
 
Posts: n/a
Default Change Table Background Macro

If Word couldn't find the table, you'd get error 5941 'The requested member
of the collection does not exist'.

You're getting the 4065 error because the document is protected for forms,
which, amongst other things, prevents you making such changes. You need to
unprotect the form, make the changes, then re-protect (NoReset = true)







"Jeff Ditty" wrote in message
...
Hello-

I am trying to write a macro that will execute when a user selects a
checkbox. When the box is selected, I want the macro to select the table
that contains the checkbox and change the background color of the table.
I can get the checkbox to execute, but when I try to select the table it
gives me a runtime error "4065....command is not available". It appears
that is cannot find the table I am referring to....

I am selecting the table and changing the background using the following:

ActiveDocument.Tables(4).Shading .BackgroundPatternColor = wdColorGray50

Anyone have any ideas why it is not finding the table?

Thanks,

Jeff



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change text direction of drop down field in table? Lurch003 Tables 3 March 28th 06 08:42 PM
Color change of the gray background of a Word Document stevel Microsoft Word Help 2 February 16th 06 08:42 PM
Word 2003: Can one disable table styles? [email protected] Tables 5 April 10th 05 10:02 AM
How do I change a tiff background from black to white? Maynard Microsoft Word Help 0 March 15th 05 10:05 PM
Word 2003 Table AutoFormat vs Macro vs VBA Kind writer/user/programmer Tables 1 October 28th 04 03:14 PM


All times are GMT +1. The time now is 03:56 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"