merging docs in SharePoing

E

eleysium

I am using Word 03 and storing my docs in a SharePoint doc library on
XP. I have an empty document. I also have other documents that I am
merging into this empty document to create a final doc. I do this
using the INCLUDETEXT field (Insert > Field > INCLUDETEXT > doc URL).
My problem is that the formatting for the docs that I import gets
completely hosed. Any ideas on what I am doing wrong?
 
S

Steve G

I am using Word 03 and storing my docs in a SharePoint doc library on
XP. I have an empty document. I also have other documents that I am
merging into this empty document to create a final doc. I do this
using the INCLUDETEXT field (Insert > Field > INCLUDETEXT > doc URL).
My problem is that the formatting for the docs that I import gets
completely hosed. Any ideas on what I am doing wrong?

The following two article by Dave Rado, Word MVP may help you.

Steve G

http://word.mvps.org/FAQs/Formatting/PasteWithoutSectionInfo.htm

How is it possible to copy an entire document into another document
without bringing across the header and footer?

I have tried Copy & Paste and Insert + File but this brings across the
header & footer and the Page setup

Article contributed by Dave Rado

When you copy and paste between documents, the section information
(Page Setup, Headers, Footers, Column format) will come over to the
document you paste into, only if:

Either:

1. The selection you copied contains section breaks; in which case,
the section information of the section preceding the section break(s)
will come over, but not the section information of the section
following the section break(s).

Or:

2. The document you are pasting into is completely blank (other than
the empty paragraph that all "blank" documents contain); and the final
paragraph mark of the document you are copying from was selected when
you copied.1


Similarly, when you insert one document into another using Insert +
File, the section information will come over to the document you
insert into, only if:

Either:

1. The file you inserted contains section breaks; in which case, the
section information of the section preceding the section break(s) will
come over, but not the section information of the section following
the section break(s).

Or:

2. The document you are inserting the file into is completely blank
(other than the empty paragraph that all "blank" documents contain).


If you don't want the section information to come over when you copy
and paste or when you select Insert + File, then:

1. First, you must delete any section breaks in the source document,
(or if copying only part of the source document, within that part).
The quickest way is to use Find & Replace.

2. a) If using copy and paste, then unless the target document is
blank, the section information won't be pasted. If the target document
is blank, you can either create a dummy paragraph in the target
document before you paste (press Return); or you can de-select the
final paragraph mark (press Shift + left arrow) in the source document
before copying. Either way, the section information won't be pasted.

I would recommend creating the dummy paragraph, rather than
deselecting the final paragraph, because the latter method prevents
the Style property of the final paragraph from being retained, which
is undesirable.

b) If using Insert + File, then again, unless the target document is
blank, the headers & footers won't be inserted. If the target document
is blank, you have to create a dummy paragraph in the target document
before you insert the file, and then the section information won't be
inserted.

See also: Working with sections.

__________________

1.
This latter behaviour breaks all rules of logic, because after
pasting, the final paragraph mark of the target document is preceded
by the final paragraph of what was pasted; so logically, the section
formatting of the target document, stored in its final paragraph mark
(see Working with sections), should be retained after pasting, and
isn't.

In fact, what seems to be happening is that (by design), after
pasting, the section information of the source document is transferred
"on the fly" from the penultimate paragraph mark to the final
paragraph mark of the target document.

The reason for the "design" is probably the fact that there is no
other way of transferring the page setup between documents when
pasting or inserting files, short of inserting a section break at the
end of the source document before copying it; and redundant section
breaks can be a nightmare. But it is confusing; and a "Do you want to
transfer the page setup?" message box when you paste would have helped
(only if you'd copied the final paragraph mark and the target was
blank, of course). And/or a setting under Tools + Options to allow you
to turn off this behaviour would be nice as well. If you agree, do
email (e-mail address removed).

http://word.mvps.org/FAQs/Formatting/WorkWithSections.htm

Working with sections

Or:
Why Word appears to behave so illogically when you delete or move a
section break

Or:
How to preserve section formatting when pasting between documents


Article contributed by Dave Rado

1. How Word sections work

2. Preserving section formatting when pasting between documents

3. If you really want to delete the temporary section break ...

4. Preserving section formatting when using Insert + File

5. Merging sections
(to return to top, press Ctrl+Home, or use Alt + Left Arrow to Go
Back)


How Word sections work
Section breaks store the following information:

1. The Headers and Footers (and their properties) for the section.

2. The Page Setup for the section.

3. The Columns settings for the section.


When you delete a section break, or move an entire section to another
part of the document, you get what seem to be very strange results.
For instance, deleting a Continuous section break causes the preceding
Next Page section break to convert to a Continuous one, or deleting a
section break causes an important Header to disappear from the
document, or causes the entire document to become landscape..

I agree it's confusing, but it's "by design". These are the rules to
remember:

1. A section break stores the formatting (page setup, header/footers
etc.) of the preceding section.

2. The final paragraph of the document contains an invisible section
break

3. When you delete a section break, the properties stored in the
section break are deleted, and the text which formerly preceded the
section break takes on the properties stored in the next section
break.

4. A section break displays the "Continuous" or "Next Page" property
of the following section!


So let's say you have 3 sections.


Section 1 has "Section Start Continuous" defined under Page Setup.
The properties of section 1 are stored in the first section break. So
the section break at the end of Section 1 stores the information
"Section Start Continuous".


Section 2 has "Section Start Next Page" defined under Page Setup. So
the section break at the end of Section 1 displays the information
"Section Break Next Page". Meanwhile the section break at the end of
section 2 stores the information "Section Start Next Page".


Section 3 has "Section Start Continuous" defined under Page Setup. So
the section break at the end of Section 2 displays the information
"Section Break Continuous" and the invisible section break at the end
of the document stores the information "Section Start Continuous".


Now if you delete the second section break, the text which preceded it
will take on the formatting of the next section (formerly Section 3,
now Section 2), which has "Section Start Continuous" defined. So the
first section break will now display "Section Break Continuous"
whereas before it displayed "Section Break Next Page".

Preserving section formatting when pasting between documents
The secret to preserving Headers and Footers, Next Page information,
etc. when copying and pasting between documents is to temporarily add
a section break at the end of the text you are going to paste or
insert.

So for example, Instead of:

Some text

Some text

Some text

.... add an extra section break temporarily, so it's like this:

Some text

Some text

Some text


Copy up to and including the temporary section break, which thus
preserves the section formatting of the text preceding it. Now paste
into the other document. Close the first document without saving.

If the target document is completely blank, however, see also: How is
it possible to copy an entire document into another document without
bringing across the header and footer?


If you really want to delete the temporary section break ...
Unfortunately, you can't then delete the "temporary" section break(s)
from the document you pasted into, or you'll still lose the
formatting. This can sometimes lead to a section break being the next-
to-last character in the document, which can be awkward.

If you want to get rid of it, you first have to make sure that the
section formatting of the final section is identical to that of the
preceding one. To do this:

1. Go to the very end of the document, and go into the final
section's header. If it's a continuous section break, you will first
need to temporarily create a page break at the end of the document, so
that you don't go into the previous section's Header.
2. Make sure that both the Header and Footer are set to "Same as
Previous". If they aren't, use the Header/Footer toolbar to set it to
this. Then return to the main document.

3. Go to the penultimate section, select File + Page Setup... and
press Return. (This makes Word "Remember" all the settings in the
dialog).

4. Go to the final section and press F4 (repeat last command). This
applies the "remembered" settings to the final section.

5. If there are differences in the column formatting between the two
sections, you'll also need to use the F4 trick with the Format +
Columns... dialog.

6. You can now safely delete the final section break (and the manual
page break, if you inserted one).

Preserving section formatting when using Insert + File
The rules section breaks follow when using Insert + File are even more
Alice-in-Wonderland than elsewhere; but the fix is straightforward:
the files you plan to insert must contain a continuous section break
at the start of the document, as well as at the end. (Alternatively,
just stick to copy & paste, which works more logically).

If you're using Insert + File, Word inserts the saved version of the
document, so you would need to save the file you're inserting, having
inserted the extra section breaks, in order to have the temporary
section breaks included when the file is inserted. You can, if you
want, subsequently delete the temporary breaks and save the file
again.

Here is some information that a source of mine at Microsoft found in
the Office 2000 bug database regarding this

"We preserve the last section of the destination's section properties
by copying them to the first section of the source. The workaround
will work if the source document starts with a continuous section
break. We can't fix this bug without breaking another scenario. I say
we let it lie instead of reverting back to Word '95 behavior and
breaking something else".

I wrote back to him: "The workaround works, but I'm still trying to
get my head around it! <g>". He replied: "Don't bother trying to
figure out the reasoning. I'm of the opinion that it really should
work the way that you were originally trying to do it. There's just no
way of getting a program manager to agree with me and change it
now... :)"

The problem you will get if you don't use this fix can be reproduced
as follows:

1. Create a new document (Doc1) and add a next page section break.

2. Set up section 1 with 1" margins and section 2 with 2" margins.
Save and
close.

3. Create a second new document (Doc2) and give it 3" margins.

4. Select Insert + File, and insert Doc1 into Doc2.

What one would expect to get is as follows:

1. The final paragraph mark of Doc2 originally contains section
formatting
of 3" margins, so the final section of Doc2 should still have 3"
margins
following the InsertFile.

2. The section break inserted into Doc2 from Doc1 contains the
section
formatting of 1" margins, so section 1 following the insertion should
have
1" margins.

In fact, after inserting Doc2 into Doc1, section 2 has 2" margins, and
section 1 has 3" margins.

Inserting a section break at the end of Doc1 doesn't help. What
happens then is that after inserting Doc1 into Doc2, section 1 has 3"
margins, section 2 has 2" margins, and section 3 has 2" margins.

In other words, whatever you do, the section formatting of section 1
in Doc1 is lost when inserted into Doc2.

If you insert a section break into Doc2 prior to inserting Doc1, it
makes no difference - the section formatting of Section 1 is lost
whatever you do. And you don't get these problems if you copy and
paste.

As previously mentioned, the only fix is to insert a continuous
section break at the start of the document you want to insert.

If the target document is completely blank, however, see also: How is
it possible to copy an entire document into another document without
bringing across the header and footer?

Merging sections
If you want to merge two contiguous sections within a document, the
same logic applies as described above under How Word sections work;
with the following implications

1. If you want the section formatting of the second section to take
precedence, no problem: it will, automatically.

2. If you want the section formatting of the first section to take
precedence, and if the second section is followed by a section break
(that is, if the document contains three or more sections), just
select the first section break, Edit + Cut, and, immediately before
the next section break, select Edit + Paste. Then delete the next
section break, leaving the one you just pasted in place. What was
previously the first section's section break has now become the merged
section's section break.

3. If you want the section formatting of the first section to take
precedence, and if the document only contains two sections, you can
either cut the section break and paste it into an empty paragraph at
the very end of the document (but then you're stuck with a redundant
section break); or make sure that the section formatting of the final
section is identical to that of the preceding one, by using the
shortcuts described under If you really want to delete the temporary
section break .... You can then safely delete the section break.
 
E

eleysium

Thanks Steve, but I used INCLUDETEXT, not any of the methods mentioned
in this article.

Can anyone help?

Joel
 

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