Insert Section Breaks and protect Sections using OLE2

W

Word.user

Hi.
I am launching word from Oracle forms using OLE2 funcionality
can anyone tell me the code to insert sections and protecting them
 
D

Doug Robbins - Word MVP

The following will insert a continuous section break at the location of the
selection and protect the section after that break.

Dim asection As Section
Dim arange As Range
Set arange = Selection.Range
Set asection = ActiveDocument.Sections.Add(arange, wdSectionContinuous)
asection.ProtectedForForms = True
ActiveDocument.Protect wdAllowOnlyFormFields


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
W

Word.user

Thanks for the info,
I want to add and delete sesctions dynamically, so how can I delete all the
existing sections in a document when I open and then add the new. I have got
the add new sections, but how can I delete all sections in a document when I
Open the document?
 
D

Doug Robbins - Word MVP

Use Edit>Replace with ^b in the Find what control and nothing in the Replace
with control.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
W

Word.user

Thanks a lot....

Doug Robbins - Word MVP said:
Use Edit>Replace with ^b in the Find what control and nothing in the Replace
with control.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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