View Single Post
  #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