"grouping" a table to prevent change from users

L

Lauro

Hi,

I would like to group an entire table with a wdContentControlGroup type
of Content Control to prevent editing from users except in some
wdContentControlRichText type of Content Control.

I'm having problem in passing the right Range of the table.

If I use:

With ActiveDocument
Set r = .Tables(1).Range
Set objcc = .ContentControls.Add(wdContentControlGroup, r)
End With

an error "5224" "Wrong selection" arise.

If I use:

With ActiveDocument
.Tables(1).Select
Set objcc = .ContentControls.Add(wdContentControlGroup)
End With

it's fine. Isn't strange?

Anyway, the Start Group Tag is inside the First Cell and the End Group Tag
is inside the Last Cell. I would image that should be around the table.

If I select the Content Control

Set objcc = ActiveDocument.ContentControls.Item(1)
objcc.Range.Select

Only the first column is selected.

Any advise? Thanks in advance, Lauro
 
L

Lauro

Hi,

after more testing I discovered:

1) Error "5224" has nothing to do with table range, also with simple
paragraphs I get the same error.

2) But if I insert a wdContentControlRichText Content Control this problem
doesn't arise.

i.e.:

With ActiveDocument
Set r = .Tables(1).Range
Set objcc = .ContentControls.Add(wdContentControlRichText, r)
End With

is fine

I' even more confused!

Thanks for any help, Lauro
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top