Hello,

I'm hoping someone might be able to "donate" some code for two seperate
case:

1- Create a page after the last page in the document wish would be in a new
section.
2- Change the page setup of the current document so that the current page
would be the start of a new section

Thanks for the help. I'm having a really hard time programming anything to
do with section management?!

Daniel

RE: Macro to create section by Sabaka

Sabaka
Fri Jan 07 23:37:01 CST 2005

Sub AddSect()
'add a new section at end of document
Dim char As Range
'set char to the last character in the document
Set char = ActiveDocument.Range.Characters.Last
'With sections collection object, use add method to add a section
ActiveDocument.Sections.Add Range:=char
End Sub

"Daniel" wrote:

> Hello,
>
> I'm hoping someone might be able to "donate" some code for two seperate
> case:
>
> 1- Create a page after the last page in the document wish would be in a new
> section.
> 2- Change the page setup of the current document so that the current page
> would be the start of a new section
>
> Thanks for the help. I'm having a really hard time programming anything to
> do with section management?!
>
> Daniel
>
>
>

RE: Macro to create section by Sabaka

Sabaka
Fri Jan 07 23:51:01 CST 2005

About your second question, what do you mean by "current page"? My
understanding is that Word isn't really designed around pages. As I
understand it, Word sees a document as a collection of sections, ranges,
paragraphs and characters. If the "current page" is just the one where the
cursor is blinking, then why not just use the insert menu to insert a break
at the cursor? If the current page is something else, I think you need to
define it in terms of a range or a section or something Word understands.

"Daniel" wrote:

> Hello,
>
> I'm hoping someone might be able to "donate" some code for two seperate
> case:
>
> 1- Create a page after the last page in the document wish would be in a new
> section.
> 2- Change the page setup of the current document so that the current page
> would be the start of a new section
>
> Thanks for the help. I'm having a really hard time programming anything to
> do with section management?!
>
> Daniel
>
>
>

Re: Macro to create section by Daniel

Daniel
Thu Jan 13 20:41:29 CST 2005

Thank you for the help, it was exactly what I was looking for!


"Sabaka" <Sabaka@discussions.micorsoft.com> wrote in message
news:92F146AC-A469-4B5A-B363-250791CC95A4@microsoft.com...
> Sub AddSect()
> 'add a new section at end of document
> Dim char As Range
> 'set char to the last character in the document
> Set char = ActiveDocument.Range.Characters.Last
> 'With sections collection object, use add method to add a section
> ActiveDocument.Sections.Add Range:=char
> End Sub
>
> "Daniel" wrote:
>
> > Hello,
> >
> > I'm hoping someone might be able to "donate" some code for two seperate
> > case:
> >
> > 1- Create a page after the last page in the document wish would be in a
new
> > section.
> > 2- Change the page setup of the current document so that the current
page
> > would be the start of a new section
> >
> > Thanks for the help. I'm having a really hard time programming anything
to
> > do with section management?!
> >
> > Daniel
> >
> >
> >



Re: Macro to create section by Sabaka

Sabaka
Thu Jan 13 20:51:02 CST 2005

you're welcome!

"Daniel" wrote:

> Thank you for the help, it was exactly what I was looking for!
>
>
> "Sabaka" <Sabaka@discussions.micorsoft.com> wrote in message
> news:92F146AC-A469-4B5A-B363-250791CC95A4@microsoft.com...
> > Sub AddSect()
> > 'add a new section at end of document
> > Dim char As Range
> > 'set char to the last character in the document
> > Set char = ActiveDocument.Range.Characters.Last
> > 'With sections collection object, use add method to add a section
> > ActiveDocument.Sections.Add Range:=char
> > End Sub
> >
> > "Daniel" wrote:
> >
> > > Hello,
> > >
> > > I'm hoping someone might be able to "donate" some code for two seperate
> > > case:
> > >
> > > 1- Create a page after the last page in the document wish would be in a
> new
> > > section.
> > > 2- Change the page setup of the current document so that the current
> page
> > > would be the start of a new section
> > >
> > > Thanks for the help. I'm having a really hard time programming anything
> to
> > > do with section management?!
> > >
> > > Daniel
> > >
> > >
> > >
>
>
>

Re: Macro to create section by Daniel

Daniel
Sun Jan 16 20:08:54 CST 2005

Sabaka,

After testing the code you gave me, I have one more request to ask of
you. Could you illustrate how I can insert a section but having a different
header and footer than the previous section?

Thank you once again,

Daniel

"Sabaka" <Sabaka@discussions.micorsoft.com> wrote in message
news:83D5808E-8B1A-41CF-97A8-396F24CC555E@microsoft.com...
> you're welcome!
>
> "Daniel" wrote:
>
> > Thank you for the help, it was exactly what I was looking for!
> >
> >
> > "Sabaka" <Sabaka@discussions.micorsoft.com> wrote in message
> > news:92F146AC-A469-4B5A-B363-250791CC95A4@microsoft.com...
> > > Sub AddSect()
> > > 'add a new section at end of document
> > > Dim char As Range
> > > 'set char to the last character in the document
> > > Set char = ActiveDocument.Range.Characters.Last
> > > 'With sections collection object, use add method to add a section
> > > ActiveDocument.Sections.Add Range:=char
> > > End Sub
> > >
> > > "Daniel" wrote:
> > >
> > > > Hello,
> > > >
> > > > I'm hoping someone might be able to "donate" some code for two
seperate
> > > > case:
> > > >
> > > > 1- Create a page after the last page in the document wish would be
in a
> > new
> > > > section.
> > > > 2- Change the page setup of the current document so that the current
> > page
> > > > would be the start of a new section
> > > >
> > > > Thanks for the help. I'm having a really hard time programming
anything
> > to
> > > > do with section management?!
> > > >
> > > > Daniel
> > > >
> > > >
> > > >
> >
> >
> >