Hi, All --

I have a VBA program that inserts a file into the active document.
This file might have a section break at the end, and if it does, it
might be a page section break, or a continuous section break.

But invariably, when the file is inserted using selection.insertfile,
the section break becomes a page section break, no matter what kind of
section break it was in the original file. Does anyone know why this
is and what can be done to stop this from happening (or a workaround
to "transparently" correct it after the fact)? I need the type of the
section break to be maintained after the file insertion.

TIA--
--larry

Re: insertfile and section breaks by Tony

Tony
Thu Jul 17 10:48:10 PDT 2008

What fun these things are!

A section break shows the start type of the *following* section. When you
copy a section (including its break) but not the following section, then how
the section break shows when pasted may change to reflect the section that
then follows it. If you want to change the start type of the section, which
already exists in your target document, based on the start type of a section
in your source document, you must expicitly code it yourself - copying and
pasting the section before it will never do it for you.

--
Enjoy,
Tony

"Larry" <larrysulky@gmail.com> wrote in message
news:611ae215-4087-411f-8b86-5115e1df88b6@56g2000hsm.googlegroups.com...
> Hi, All --
>
> I have a VBA program that inserts a file into the active document.
> This file might have a section break at the end, and if it does, it
> might be a page section break, or a continuous section break.
>
> But invariably, when the file is inserted using selection.insertfile,
> the section break becomes a page section break, no matter what kind of
> section break it was in the original file. Does anyone know why this
> is and what can be done to stop this from happening (or a workaround
> to "transparently" correct it after the fact)? I need the type of the
> section break to be maintained after the file insertion.
>
> TIA--
> --larry


Re: insertfile and section breaks by Larry

Larry
Fri Jul 18 06:18:52 PDT 2008

Ah, yes. Thank you, Tony. I had got myself turned around (again) on
these silly section breaks. The behaviour I see now is this: If I
insert a side file that has one or more section breaks, the final
section break will change to whatever type of section break was in
effect in the base file at the point of the insertion of the side
file.

Now if only I had code that could examine the type of the final
section break (if any) of the side file before inserting it...
hmm.... :-)

----larry

Re: insertfile and section breaks by Tony

Tony
Fri Jul 18 06:31:46 PDT 2008

Gotta be brief ...

Range.Sections.Last.PageSetup.SectionStart

:-)

--
Enjoy,
Tony

"Larry" <larrysulky@gmail.com> wrote in message
news:5ab7159f-e405-4e2f-8e2f-e740dfae6373@w1g2000prk.googlegroups.com...
> Ah, yes. Thank you, Tony. I had got myself turned around (again) on
> these silly section breaks. The behaviour I see now is this: If I
> insert a side file that has one or more section breaks, the final
> section break will change to whatever type of section break was in
> effect in the base file at the point of the insertion of the side
> file.
>
> Now if only I had code that could examine the type of the final
> section break (if any) of the side file before inserting it...
> hmm.... :-)
>
> ----larry


Re: insertfile and section breaks by Larry

Larry
Fri Jul 18 07:46:59 PDT 2008

On Jul 18, 9:31=A0am, "Tony Jollans" <My forename at my surname dot com>
wrote:
> Gotta be brief ...
>
> =A0 =A0 Range.Sections.Last.PageSetup.SectionStart
>
> :-)
>
> --
> Enjoy,
> Tony
>

Perfect! I just open the side file first, peek at its final section
break, close it, insert it, and reset the section break to what it is
supposed to be.

I don't care what everybody else says, you are okay in my book, Tony.
Thanks!
---larry

Re: insertfile and section breaks by Stefan

Stefan
Mon Jul 21 02:43:05 PDT 2008

For more on section breaks and Insert File in Word, you may also want to
read the article at
http://word.mvps.org/faqs/formatting/WorkWithSections.htm.

--
Stefan Blom
Microsoft Word MVP


"Larry" <larrysulky@gmail.com> wrote in message
news:9b416e4f-5b07-4bad-8f0f-55ce3bdf89a9@w9g2000prd.googlegroups.com...
On Jul 18, 9:31 am, "Tony Jollans" <My forename at my surname dot com>
wrote:
> Gotta be brief ...
>
> Range.Sections.Last.PageSetup.SectionStart
>
> :-)
>
> --
> Enjoy,
> Tony
>

Perfect! I just open the side file first, peek at its final section
break, close it, insert it, and reset the section break to what it is
supposed to be.

I don't care what everybody else says, you are okay in my book, Tony.
Thanks!
---larry



Re: insertfile and section breaks by Tony

Tony
Tue Jul 22 10:51:56 PDT 2008

Sorry I was so brief but I was just on my way out the door for the weekend
(I'm back now :-)) and I thought something was better than nothing. Glad it
worked for you.

--
Enjoy,
Tony

"Larry" <larrysulky@gmail.com> wrote in message
news:9b416e4f-5b07-4bad-8f0f-55ce3bdf89a9@w9g2000prd.googlegroups.com...
On Jul 18, 9:31 am, "Tony Jollans" <My forename at my surname dot com>
wrote:
> Gotta be brief ...
>
> Range.Sections.Last.PageSetup.SectionStart
>
> :-)
>
> --
> Enjoy,
> Tony
>

Perfect! I just open the side file first, peek at its final section
break, close it, insert it, and reset the section break to what it is
supposed to be.

I don't care what everybody else says, you are okay in my book, Tony.
Thanks!
---larry