Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.pagelayout
[email protected] spovolny@gmail.com is offline
external usenet poster
 
Posts: 1
Default How do I add section breaks in VBA?

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

  #2   Report Post  
Posted to microsoft.public.word.pagelayout
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default How do I add section breaks in VBA?

Dim myrange As Range, myrange2 As Range
Set myrange = Selection.Range
Set myrange2 = myrange.Duplicate
myrange.InsertBreak wdSectionBreakContinuous
myrange2.Collapse wdCollapseEnd
myrange2.InsertBreak wdSectionBreakContinuous


--
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

wrote in message
ps.com...
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



  #3   Report Post  
Posted to microsoft.public.word.pagelayout
Bear[_2_] Bear[_2_] is offline
external usenet poster
 
Posts: 314
Default How do I add section breaks in VBA?

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
--
Windows XP, Word 2000


"Doug Robbins - Word MVP" wrote:

Dim myrange As Range, myrange2 As Range
Set myrange = Selection.Range
Set myrange2 = myrange.Duplicate
myrange.InsertBreak wdSectionBreakContinuous
myrange2.Collapse wdCollapseEnd
myrange2.InsertBreak wdSectionBreakContinuous


--
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

wrote in message
ps.com...
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




  #4   Report Post  
Posted to microsoft.public.word.pagelayout
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default How do I add section breaks in VBA?

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.

--
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

"Bear" (nospam) wrote in message
...
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
--
Windows XP, Word 2000


"Doug Robbins - Word MVP" wrote:

Dim myrange As Range, myrange2 As Range
Set myrange = Selection.Range
Set myrange2 = myrange.Duplicate
myrange.InsertBreak wdSectionBreakContinuous
myrange2.Collapse wdCollapseEnd
myrange2.InsertBreak wdSectionBreakContinuous


--
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

wrote in message
ps.com...
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






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
Replace Section Breaks with Page Breaks Automatically? Tyler T Microsoft Word Help 15 March 5th 09 07:58 AM
Continuous Section breaks, Next page section breaks, headers and f Chris K. Page Layout 8 June 3rd 08 02:57 PM
Converting page breaks to section breaks automatically- 2007 Freida Page Layout 5 January 11th 07 06:00 PM
Replace Section Breaks with Page Breaks Automatically? Tyler T Microsoft Word Help 0 October 6th 06 09:51 PM
Page breaks in document with multiple section breaks Diddakoi Microsoft Word Help 3 August 24th 05 09:17 PM


All times are GMT +1. The time now is 12:25 AM.

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"