Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Page Layout / May 2007

Tip: Looking for answers? Try searching our database.

How do I add section breaks in VBA?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
spovolny@gmail.com - 01 May 2007 19:47 GMT
I'm interested in having my entire document protected except for a
single word which I need the user to be able to edit a hyperlink.  The
word is on its own line, so I put in a continuous section break before
and after the line, and then protected all of the document except
section 2 (which is the line with the word I need unprotected).  This
seemed to work fine, but I don't know how to replicate it in code,
which I need to do.  Can anyone help?  Thanks alot,
Steve
Doug Robbins - Word MVP - 01 May 2007 21:06 GMT
Dim myrange As Range, myrange2 As Range
Set myrange = Selection.Range
Set myrange2 = myrange.Duplicate
myrange.InsertBreak wdSectionBreakContinuous
myrange2.Collapse wdCollapseEnd
myrange2.InsertBreak wdSectionBreakContinuous

Signature

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

> I'm interested in having my entire document protected except for a
> single word which I need the user to be able to edit a hyperlink.  The
[quoted text clipped - 4 lines]
> which I need to do.  Can anyone help?  Thanks alot,
> Steve
Bear - 02 May 2007 20:42 GMT
Doug:

I almost "get" the Duplicate property for ranges, but it keeps slipping
away. Do you have any way to explain it so I'll understand better?

Bear
Signature

Windows XP, Word 2000

> Dim myrange As Range, myrange2 As Range
> Set myrange = Selection.Range
[quoted text clipped - 11 lines]
> > which I need to do.  Can anyone help?  Thanks alot,
> > Steve
Doug Robbins - Word MVP - 03 May 2007 09:19 GMT
You set a duplicate range when you will be doing something to the original
range that will alter that range and then later want to perform another
operation on what was the original range.

Signature

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

> Doug:
>
[quoted text clipped - 18 lines]
>> > which I need to do.  Can anyone help?  Thanks alot,
>> > Steve
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.