Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Seamus O'Connell Seamus O'Connell is offline
external usenet poster
 
Posts: 8
Default Mail Merge and paragraph formatting

The problem looks like this:

In an xlsx worksheet Row 1 contains three column names: €˜Line1, €˜Line2,
€˜Line3.
In Row 2, the first data row:
the Line1 cell contains €˜one one one €¦. one one one in a line of text which
runs over to two lines in a Word document;
the Line2 cell is empty;
the Line3 cell contains €˜three three three €¦ three three three, another
overrunning line of text.

A docx document uses Mail Merge for a Directory and for each record outputs
Line1, Line2, and Line3 on succeeding lines, prefixed by identifying text,
suppressing the line if the cell is empty, and applying the Hanging Indent
paragraph format on each output line. So the output in this case should look
like:
Line1: one one one etc€¦
one one one the overrunning part of Line1 text
Line3: three three three etc€¦
three three three the overrunning part of Line3 text

I have encoded each line as (p+hi indicates a paragraph mark with hanging
indent set):
{ IF { MERGEFIELD Linen } "" "Linen: { MERGEFIELD Linen }p+hi" "" }

The paragraph mark is acted up on when field codes are shown so it all comes
out as:
{ IF { MERGEFIELD Line1 } "" "Line1: { MERGEFIELD Line1 }p+hi
" "" }{ IF { MERGEFIELD Line2 } "" "Line2: { MERGEFIELD Line2 }p+hi
" "" }{ IF { MERGEFIELD Line3 } "" "Line3: { MERGEFIELD Line3 }p+hi
" "" }

However, in the result the lines are all indented, coming out like this:
Line1: one one one etc€¦
one one one the overrunning part of Line1 text
Line3: three three three etc€¦
three three three the overrunning part of Line3 text

Can anyone tell me what's going on and how to fix it?

--
Seamus O'Connell
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Seamus O'Connell Seamus O'Connell is offline
external usenet poster
 
Posts: 8
Default Mail Merge and paragraph formatting

And I did try so hard to get this exactly right ....

The hanging indent should of course look like:
Line1: one one one etc€¦
one one one the overrunning part of Line1 text
Line3: three three three etc€¦
three three three the overrunning part of Line3 text

Seamus

--
Seamus O'Connell


"Seamus O'Connell" wrote:

The problem looks like this:

In an xlsx worksheet Row 1 contains three column names: €˜Line1, €˜Line2,
€˜Line3.
In Row 2, the first data row:
the Line1 cell contains €˜one one one €¦. one one one in a line of text which
runs over to two lines in a Word document;
the Line2 cell is empty;
the Line3 cell contains €˜three three three €¦ three three three, another
overrunning line of text.

A docx document uses Mail Merge for a Directory and for each record outputs
Line1, Line2, and Line3 on succeeding lines, prefixed by identifying text,
suppressing the line if the cell is empty, and applying the Hanging Indent
paragraph format on each output line. So the output in this case should look
like:
Line1: one one one etc€¦
one one one the overrunning part of Line1 text
Line3: three three three etc€¦
three three three the overrunning part of Line3 text

I have encoded each line as (p+hi indicates a paragraph mark with hanging
indent set):
{ IF { MERGEFIELD Linen } "" "Linen: { MERGEFIELD Linen }p+hi" "" }

The paragraph mark is acted up on when field codes are shown so it all comes
out as:
{ IF { MERGEFIELD Line1 } "" "Line1: { MERGEFIELD Line1 }p+hi
" "" }{ IF { MERGEFIELD Line2 } "" "Line2: { MERGEFIELD Line2 }p+hi
" "" }{ IF { MERGEFIELD Line3 } "" "Line3: { MERGEFIELD Line3 }p+hi
" "" }

However, in the result the lines are all indented, coming out like this:
Line1: one one one etc€¦
one one one the overrunning part of Line1 text
Line3: three three three etc€¦
three three three the overrunning part of Line3 text

Can anyone tell me what's going on and how to fix it?

--
Seamus O'Connell

  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Seamus O'Connell Seamus O'Connell is offline
external usenet poster
 
Posts: 8
Default Mail Merge and paragraph formatting

In some ways of viewing this post the leading spaces are being lost.

The hanging indent text I'm trying to get has the first part of the line
left-justified and the second overflow part indented. What is being produced
by Mail Merge has both parts of the line indented.

--
Seamus O'Connell


"Seamus O'Connell" wrote:

And I did try so hard to get this exactly right ....

The hanging indent should of course look like:
Line1: one one one etc€¦
one one one the overrunning part of Line1 text
Line3: three three three etc€¦
three three three the overrunning part of Line3 text

Seamus

--
Seamus O'Connell


"Seamus O'Connell" wrote:

The problem looks like this:

In an xlsx worksheet Row 1 contains three column names: €˜Line1, €˜Line2,
€˜Line3.
In Row 2, the first data row:
the Line1 cell contains €˜one one one €¦. one one one in a line of text which
runs over to two lines in a Word document;
the Line2 cell is empty;
the Line3 cell contains €˜three three three €¦ three three three, another
overrunning line of text.

A docx document uses Mail Merge for a Directory and for each record outputs
Line1, Line2, and Line3 on succeeding lines, prefixed by identifying text,
suppressing the line if the cell is empty, and applying the Hanging Indent
paragraph format on each output line. So the output in this case should look
like:
Line1: one one one etc€¦
one one one the overrunning part of Line1 text
Line3: three three three etc€¦
three three three the overrunning part of Line3 text

I have encoded each line as (p+hi indicates a paragraph mark with hanging
indent set):
{ IF { MERGEFIELD Linen } "" "Linen: { MERGEFIELD Linen }p+hi" "" }

The paragraph mark is acted up on when field codes are shown so it all comes
out as:
{ IF { MERGEFIELD Line1 } "" "Line1: { MERGEFIELD Line1 }p+hi
" "" }{ IF { MERGEFIELD Line2 } "" "Line2: { MERGEFIELD Line2 }p+hi
" "" }{ IF { MERGEFIELD Line3 } "" "Line3: { MERGEFIELD Line3 }p+hi
" "" }

However, in the result the lines are all indented, coming out like this:
Line1: one one one etc€¦
one one one the overrunning part of Line1 text
Line3: three three three etc€¦
three three three the overrunning part of Line3 text

Can anyone tell me what's going on and how to fix it?

--
Seamus O'Connell

  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Mail Merge and paragraph formatting

Off the top of my head: have you tried formatting the paragraph(s) that
contain the { IF } field sequence with the formatting you want (i.e. as
well as the paragraphs inside the IF field results)?

Peter Jamieson

http://tips.pjmsn.me.uk

On 21/02/2010 17:50, Seamus O'Connell wrote:
The problem looks like this:

In an xlsx worksheet Row 1 contains three column names: €˜Line1, €˜Line2,
€˜Line3.
In Row 2, the first data row:
the Line1 cell contains €˜one one one €¦. one one one in a line of text which
runs over to two lines in a Word document;
the Line2 cell is empty;
the Line3 cell contains €˜three three three €¦ three three three, another
overrunning line of text.

A docx document uses Mail Merge for a Directory and for each record outputs
Line1, Line2, and Line3 on succeeding lines, prefixed by identifying text,
suppressing the line if the cell is empty, and applying the Hanging Indent
paragraph format on each output line. So the output in this case should look
like:
Line1: one one oneetc€¦
one one onethe overrunning part of Line1 text
Line3: three three threeetc€¦
three three threethe overrunning part of Line3 text

I have encoded each line as (p+hi indicates a paragraph mark with hanging
indent set):
{ IF { MERGEFIELD Linen } "" "Linen: { MERGEFIELD Linen }p+hi" "" }

The paragraph mark is acted up on when field codes are shown so it all comes
out as:
{ IF { MERGEFIELD Line1 } "" "Line1: { MERGEFIELD Line1 }p+hi
" "" }{ IF { MERGEFIELD Line2 } "" "Line2: { MERGEFIELD Line2 }p+hi
" "" }{ IF { MERGEFIELD Line3 } "" "Line3: { MERGEFIELD Line3 }p+hi
" "" }

However, in the result the lines are all indented, coming out like this:
Line1: one one oneetc€¦
one one onethe overrunning part of Line1 text
Line3: three three threeetc€¦
three three threethe overrunning part of Line3 text

Can anyone tell me what's going on and how to fix it?

  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Seamus O'Connell Seamus O'Connell is offline
external usenet poster
 
Posts: 8
Default Mail Merge and paragraph formatting


Peter - I tried formatting the entire document with Hanging Indent. Didn't
work. Still got the first line of the generated paragraph indented the same
as the second overflow line. But thanks for the thought. Seamus

--
Seamus O'Connell


"Peter Jamieson" wrote:

Off the top of my head: have you tried formatting the paragraph(s) that
contain the { IF } field sequence with the formatting you want (i.e. as
well as the paragraphs inside the IF field results)?

Peter Jamieson

http://tips.pjmsn.me.uk



  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Mail Merge and paragraph formatting

FWIW I can't make it do what you want. Word 2003 was slightly better in
this respect, but even setting the document compatibility to Word 2003
in Tools-Options does not appear to make a difference, so it must
another change in the layout engine.

Peter Jamieson

http://tips.pjmsn.me.uk

On 22/02/2010 00:36, Seamus O'Connell wrote:

Peter - I tried formatting the entire document with Hanging Indent. Didn't
work. Still got the first line of the generated paragraph indented the same
as the second overflow line. But thanks for the thought. Seamus

  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Mail Merge and paragraph formatting

The following field construction

{ IF { MERGEFIELD Line1 } "" "Line 1: { MERGEFIELD Line1 }¶
" "" }{ IF { MERGEFIELD Line2 } "" "Line 2: { MERGEFIELD Line2 }¶
" "" }{ IF { MERGEFIELD Line3 } "" "Line 1: { MERGEFIELD Line3 }¶
" "" }¶

where ¶ represents a carriage return, with each of those paragraphs
formatted with the hanging indent provides the desired result in Word 2007
here.

Copying and pasting the result into a plain text email message, the indents
are lost, but in the word document each of the paragraphs starting with the
word "Line" has a hanging indent.

Line 1 On the Insert tab, the galleries include items that are designed to
coordinate with the overall look of your document. You can use these
galleries to insert tables, headers, footers, lists, cover pages, and other
document building blocks. When you create pictures, charts, or diagrams,
they also coordinate with your current document look.
Line 2 You can easily change the formatting of selected text in the
document text by choosing a look for the selected text from the Quick Styles
gallery on the Home tab. You can also format text directly by using the
other controls on the Home tab. Most controls offer a choice of using the
look from the current theme or using a format that you specify directly.
Line 3 To change the overall look of your document, choose new Theme
elements on the Page Layout tab. To change the looks available in the Quick
Style gallery, use the Change Current Quick Style Set command. Both the
Themes gallery and the Quick Styles gallery provide reset commands so that
you can always restore the look of your document to the original contained
in your current template.
Line 2 You can easily change the formatting of selected text in the
document text by choosing a look for the selected text from the Quick Styles
gallery on the Home tab. You can also format text directly by using the
other controls on the Home tab. Most controls offer a choice of using the
look from the current theme or using a format that you specify directly.
Line 3 To change the overall look of your document, choose new Theme
elements on the Page Layout tab. To change the looks available in the Quick
Style gallery, use the Change Current Quick Style Set command. Both the
Themes gallery and the Quick Styles gallery provide reset commands so that
you can always restore the look of your document to the original contained
in your current template.
Line 1 On the Insert tab, the galleries include items that are designed to
coordinate with the overall look of your document. You can use these
galleries to insert tables, headers, footers, lists, cover pages, and other
document building blocks. When you create pictures, charts, or diagrams,
they also coordinate with your current document look.
Line 3 To change the overall look of your document, choose new Theme
elements on the Page Layout tab. To change the looks available in the Quick
Style gallery, use the Change Current Quick Style Set command. Both the
Themes gallery and the Quick Styles gallery provide reset commands so that
you can always restore the look of your document to the original contained
in your current template.
Line 1 On the Insert tab, the galleries include items that are designed to
coordinate with the overall look of your document. You can use these
galleries to insert tables, headers, footers, lists, cover pages, and other
document building blocks. When you create pictures, charts, or diagrams,
they also coordinate with your current document look.
Line 2 You can easily change the formatting of selected text in the
document text by choosing a look for the selected text from the Quick Styles
gallery on the Home tab. You can also format text directly by using the
other controls on the Home tab. Most controls offer a choice of using the
look from the current theme or using a format that you specify directly.

In the data source, record one contained data in all three fields, in record
2, the Line 1 field was empty, in record 3, the Line 2 field was empty and
in Record 4, the Line 3 field was empty.

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.

"Seamus O'Connell" wrote in
message ...

Peter - I tried formatting the entire document with Hanging Indent. Didn't
work. Still got the first line of the generated paragraph indented the
same
as the second overflow line. But thanks for the thought. Seamus

--
Seamus O'Connell


"Peter Jamieson" wrote:

Off the top of my head: have you tried formatting the paragraph(s) that
contain the { IF } field sequence with the formatting you want (i.e. as
well as the paragraphs inside the IF field results)?

Peter Jamieson

http://tips.pjmsn.me.uk


  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Mail Merge and paragraph formatting

Can we compare versions?

Here, I'm using Vista 32-bit SP2, Word 2007 SP2


Peter Jamieson

http://tips.pjmsn.me.uk

On 22/02/2010 06:19, Doug Robbins - Word MVP wrote:
The following field construction

{ IF { MERGEFIELD Line1 } "" "Line 1: { MERGEFIELD Line1 }¶
" "" }{ IF { MERGEFIELD Line2 } "" "Line 2: { MERGEFIELD Line2 }¶
" "" }{ IF { MERGEFIELD Line3 } "" "Line 1: { MERGEFIELD Line3 }¶
" "" }¶

where ¶ represents a carriage return, with each of those paragraphs
formatted with the hanging indent provides the desired result in Word
2007 here.

Copying and pasting the result into a plain text email message, the
indents are lost, but in the word document each of the paragraphs
starting with the word "Line" has a hanging indent.

Line 1 On the Insert tab, the galleries include items that are designed
to coordinate with the overall look of your document. You can use these
galleries to insert tables, headers, footers, lists, cover pages, and
other document building blocks. When you create pictures, charts, or
diagrams, they also coordinate with your current document look.
Line 2 You can easily change the formatting of selected text in the
document text by choosing a look for the selected text from the Quick
Styles gallery on the Home tab. You can also format text directly by
using the other controls on the Home tab. Most controls offer a choice
of using the look from the current theme or using a format that you
specify directly.
Line 3 To change the overall look of your document, choose new Theme
elements on the Page Layout tab. To change the looks available in the
Quick Style gallery, use the Change Current Quick Style Set command.
Both the Themes gallery and the Quick Styles gallery provide reset
commands so that you can always restore the look of your document to the
original contained in your current template.
Line 2 You can easily change the formatting of selected text in the
document text by choosing a look for the selected text from the Quick
Styles gallery on the Home tab. You can also format text directly by
using the other controls on the Home tab. Most controls offer a choice
of using the look from the current theme or using a format that you
specify directly.
Line 3 To change the overall look of your document, choose new Theme
elements on the Page Layout tab. To change the looks available in the
Quick Style gallery, use the Change Current Quick Style Set command.
Both the Themes gallery and the Quick Styles gallery provide reset
commands so that you can always restore the look of your document to the
original contained in your current template.
Line 1 On the Insert tab, the galleries include items that are designed
to coordinate with the overall look of your document. You can use these
galleries to insert tables, headers, footers, lists, cover pages, and
other document building blocks. When you create pictures, charts, or
diagrams, they also coordinate with your current document look.
Line 3 To change the overall look of your document, choose new Theme
elements on the Page Layout tab. To change the looks available in the
Quick Style gallery, use the Change Current Quick Style Set command.
Both the Themes gallery and the Quick Styles gallery provide reset
commands so that you can always restore the look of your document to the
original contained in your current template.
Line 1 On the Insert tab, the galleries include items that are designed
to coordinate with the overall look of your document. You can use these
galleries to insert tables, headers, footers, lists, cover pages, and
other document building blocks. When you create pictures, charts, or
diagrams, they also coordinate with your current document look.
Line 2 You can easily change the formatting of selected text in the
document text by choosing a look for the selected text from the Quick
Styles gallery on the Home tab. You can also format text directly by
using the other controls on the Home tab. Most controls offer a choice
of using the look from the current theme or using a format that you
specify directly.

In the data source, record one contained data in all three fields, in
record 2, the Line 1 field was empty, in record 3, the Line 2 field was
empty and in Record 4, the Line 3 field was empty.

  #9   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Mail Merge and paragraph formatting

Hi Peter,

The original test would have been on a 32-bit version of Vista (I cannot
confirm that it was SP2 at the moment, but would be very surprised if it was
not) and Word 2007 (also almost certainly SP2 (but I cannot confirm at the
moment)

I have just retested on a machine running Word 2007 SP2 under Windows 7,
with an Excel 2010 data source (while I retained Word, I dumped the rest of
Office when I installed 2010) and using the same field construction I get
the expected result with one minor exception (which I had also experienced
on the other installation)

That is that the result of the first field in the first record appears as
follows (here, I have manually inserted carriage returns and tabs to show
the result

Line 1: On the Insert tab, the galleries include items that are designed to
coordinate with the

overall look of your document. You can use these galleries to insert
tables, headers,
footers, lists, cover pages, and other document building blocks.
When you create
pictures, charts, or diagrams, they also coordinate with your
current document look

Note that there is an empty "line" between the first and second lines.
There is however no carriage return or new line "character" after the "the"
at the end of the first line and according to the Paragraph Format dialog,
the paragraph is formatted with single line spacing.

If I change the line spacing in the Format Paragraph dialog from Single to
Double and then back to Single again, this mystery space disappears. If I
click undo to undo both instances of the paragraph formatting, the mystery
line does not re-appear.

If instead of using the Paragraph formatting dialog, I place the selection
after the word "the" at the end of the first line and press delete, the
first letter of the first word on the next line is deleted. Likewise, if I
place the selection after the word "the" at the end of the first line and
press the right arrow key, the selection moves the after the first letter of
the first word on the next line.

Apart from this anomaly with the result of the first field of the first
record, all of the other paragraphs are formatted with the required hanging
indent.

--
Regards.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"Peter Jamieson" wrote in message
...
Can we compare versions?

Here, I'm using Vista 32-bit SP2, Word 2007 SP2


Peter Jamieson

http://tips.pjmsn.me.uk

On 22/02/2010 06:19, Doug Robbins - Word MVP wrote:
The following field construction

{ IF { MERGEFIELD Line1 } "" "Line 1: { MERGEFIELD Line1 }¶
" "" }{ IF { MERGEFIELD Line2 } "" "Line 2: { MERGEFIELD Line2 }¶
" "" }{ IF { MERGEFIELD Line3 } "" "Line 1: { MERGEFIELD Line3 }¶
" "" }¶

where ¶ represents a carriage return, with each of those paragraphs
formatted with the hanging indent provides the desired result in Word
2007 here.

Copying and pasting the result into a plain text email message, the
indents are lost, but in the word document each of the paragraphs
starting with the word "Line" has a hanging indent.

Line 1 On the Insert tab, the galleries include items that are designed
to coordinate with the overall look of your document. You can use these
galleries to insert tables, headers, footers, lists, cover pages, and
other document building blocks. When you create pictures, charts, or
diagrams, they also coordinate with your current document look.
Line 2 You can easily change the formatting of selected text in the
document text by choosing a look for the selected text from the Quick
Styles gallery on the Home tab. You can also format text directly by
using the other controls on the Home tab. Most controls offer a choice
of using the look from the current theme or using a format that you
specify directly.
Line 3 To change the overall look of your document, choose new Theme
elements on the Page Layout tab. To change the looks available in the
Quick Style gallery, use the Change Current Quick Style Set command.
Both the Themes gallery and the Quick Styles gallery provide reset
commands so that you can always restore the look of your document to the
original contained in your current template.
Line 2 You can easily change the formatting of selected text in the
document text by choosing a look for the selected text from the Quick
Styles gallery on the Home tab. You can also format text directly by
using the other controls on the Home tab. Most controls offer a choice
of using the look from the current theme or using a format that you
specify directly.
Line 3 To change the overall look of your document, choose new Theme
elements on the Page Layout tab. To change the looks available in the
Quick Style gallery, use the Change Current Quick Style Set command.
Both the Themes gallery and the Quick Styles gallery provide reset
commands so that you can always restore the look of your document to the
original contained in your current template.
Line 1 On the Insert tab, the galleries include items that are designed
to coordinate with the overall look of your document. You can use these
galleries to insert tables, headers, footers, lists, cover pages, and
other document building blocks. When you create pictures, charts, or
diagrams, they also coordinate with your current document look.
Line 3 To change the overall look of your document, choose new Theme
elements on the Page Layout tab. To change the looks available in the
Quick Style gallery, use the Change Current Quick Style Set command.
Both the Themes gallery and the Quick Styles gallery provide reset
commands so that you can always restore the look of your document to the
original contained in your current template.
Line 1 On the Insert tab, the galleries include items that are designed
to coordinate with the overall look of your document. You can use these
galleries to insert tables, headers, footers, lists, cover pages, and
other document building blocks. When you create pictures, charts, or
diagrams, they also coordinate with your current document look.
Line 2 You can easily change the formatting of selected text in the
document text by choosing a look for the selected text from the Quick
Styles gallery on the Home tab. You can also format text directly by
using the other controls on the Home tab. Most controls offer a choice
of using the look from the current theme or using a format that you
specify directly.

In the data source, record one contained data in all three fields, in
record 2, the Line 1 field was empty, in record 3, the Line 2 field was
empty and in Record 4, the Line 3 field was empty.

  #10   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Mail Merge and paragraph formatting

FWIW, my experiment with Windows 7 and Word 2010 beta had exactly the
same result as my experiment with Vista and Word 2007. However, so far I
have been using data that has no internal hard line breaks (i.e. only
laid out using automatic wrapped, whether it was in Word or Excel. If I
put one or more hard breaks in the Excel text for "Line 1" (say), then
the first part of Line 1 still retains the wrong formatting, but all the
other parts of Line 1 are OK. Which is not quite what I would have
expected either.

Peter Jamieson

http://tips.pjmsn.me.uk

On 22/02/2010 09:57, Doug Robbins - Word MVP wrote:
Hi Peter,

The original test would have been on a 32-bit version of Vista (I cannot
confirm that it was SP2 at the moment, but would be very surprised if it
was not) and Word 2007 (also almost certainly SP2 (but I cannot confirm
at the moment)

I have just retested on a machine running Word 2007 SP2 under Windows 7,
with an Excel 2010 data source (while I retained Word, I dumped the rest
of Office when I installed 2010) and using the same field construction I
get the expected result with one minor exception (which I had also
experienced on the other installation)

That is that the result of the first field in the first record appears
as follows (here, I have manually inserted carriage returns and tabs to
show the result

Line 1: On the Insert tab, the galleries include items that are designed
to coordinate with the

overall look of your document. You can use these galleries to insert
tables, headers,
footers, lists, cover pages, and other document building blocks. When
you create
pictures, charts, or diagrams, they also coordinate with your current
document look

Note that there is an empty "line" between the first and second lines.
There is however no carriage return or new line "character" after the
"the" at the end of the first line and according to the Paragraph Format
dialog, the paragraph is formatted with single line spacing.

If I change the line spacing in the Format Paragraph dialog from Single
to Double and then back to Single again, this mystery space disappears.
If I click undo to undo both instances of the paragraph formatting, the
mystery line does not re-appear.

If instead of using the Paragraph formatting dialog, I place the
selection after the word "the" at the end of the first line and press
delete, the first letter of the first word on the next line is deleted.
Likewise, if I place the selection after the word "the" at the end of
the first line and press the right arrow key, the selection moves the
after the first letter of the first word on the next line.

Apart from this anomaly with the result of the first field of the first
record, all of the other paragraphs are formatted with the required
hanging indent.



  #11   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Mail Merge and paragraph formatting

Hi Peter,

My data had not hard (line or paragraph) breaks in Excel.

I think it's a bit much to expect mail merge to multi-paragraph data and
apply such formatting.

I am not sure how real the OP's description of his requirement is, but if it
was just the static text (Line #) that was to be outdented, I would setup
the main document as a two column table with and If...then...Else construct
in each column, the one in the first column returning the Line # if the data
in the field was not blank and the one in the second column returning the
data if it was not blank.

--
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, originally posted via msnews.microsoft.com

"Peter Jamieson" wrote in message
...
FWIW, my experiment with Windows 7 and Word 2010 beta had exactly the same
result as my experiment with Vista and Word 2007. However, so far I have
been using data that has no internal hard line breaks (i.e. only laid out
using automatic wrapped, whether it was in Word or Excel. If I put one or
more hard breaks in the Excel text for "Line 1" (say), then the first part
of Line 1 still retains the wrong formatting, but all the other parts of
Line 1 are OK. Which is not quite what I would have expected either.

Peter Jamieson

http://tips.pjmsn.me.uk

On 22/02/2010 09:57, Doug Robbins - Word MVP wrote:
Hi Peter,

The original test would have been on a 32-bit version of Vista (I cannot
confirm that it was SP2 at the moment, but would be very surprised if it
was not) and Word 2007 (also almost certainly SP2 (but I cannot confirm
at the moment)

I have just retested on a machine running Word 2007 SP2 under Windows 7,
with an Excel 2010 data source (while I retained Word, I dumped the rest
of Office when I installed 2010) and using the same field construction I
get the expected result with one minor exception (which I had also
experienced on the other installation)

That is that the result of the first field in the first record appears
as follows (here, I have manually inserted carriage returns and tabs to
show the result

Line 1: On the Insert tab, the galleries include items that are designed
to coordinate with the

overall look of your document. You can use these galleries to insert
tables, headers,
footers, lists, cover pages, and other document building blocks. When
you create
pictures, charts, or diagrams, they also coordinate with your current
document look

Note that there is an empty "line" between the first and second lines.
There is however no carriage return or new line "character" after the
"the" at the end of the first line and according to the Paragraph Format
dialog, the paragraph is formatted with single line spacing.

If I change the line spacing in the Format Paragraph dialog from Single
to Double and then back to Single again, this mystery space disappears.
If I click undo to undo both instances of the paragraph formatting, the
mystery line does not re-appear.

If instead of using the Paragraph formatting dialog, I place the
selection after the word "the" at the end of the first line and press
delete, the first letter of the first word on the next line is deleted.
Likewise, if I place the selection after the word "the" at the end of
the first line and press the right arrow key, the selection moves the
after the first letter of the first word on the next line.

Apart from this anomaly with the result of the first field of the first
record, all of the other paragraphs are formatted with the required
hanging indent.

  #12   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Mail Merge and paragraph formatting

Hi Doug,

I think it's a bit much to expect mail merge to multi-paragraph data and
apply such formatting.


Without further input from the OP, I certainly wouldn't want to spend
any more time on it.

What specifically interested me was that both you and I seem to have set
up or Mail Merge Main Document with identical text and formatting, and
yet we have different results - i.e., "what could account for that?" And
of course there's the question of "what ought to happen?"

I don't think the OP's expectation was unreasonable. But the question
"what do I do if Word simply does not behave the way I expect/want" is
not easily answered. I suppose in the end there has to be a manual
postprocessing step and that someone would have to
a. open the output document
b. identify the paragraphs to be fixed (somehow)
c. apply the fix
d. check the results (how?!)
e. save/print when all is well


Peter Jamieson

http://tips.pjmsn.me.uk

On 22/02/2010 19:35, Doug Robbins - Word MVP wrote:
Hi Peter,

My data had not hard (line or paragraph) breaks in Excel.

I think it's a bit much to expect mail merge to multi-paragraph data and
apply such formatting.

I am not sure how real the OP's description of his requirement is, but
if it was just the static text (Line #) that was to be outdented, I
would setup the main document as a two column table with and
If...then...Else construct in each column, the one in the first column
returning the Line # if the data in the field was not blank and the one
in the second column returning the data if it was not blank.

  #13   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Mail Merge and paragraph formatting

Hi Peter,

I just recreated my main document so that I could send it to you and
discovered something else of interest - on saving the resulting document
immediately after it was created by executing the merge (i.e. without making
any other adjustments) the mystery line was removed.

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.

"Peter Jamieson" wrote in message
...
Hi Doug,

I think it's a bit much to expect mail merge to multi-paragraph data and
apply such formatting.


Without further input from the OP, I certainly wouldn't want to spend any
more time on it.

What specifically interested me was that both you and I seem to have set
up or Mail Merge Main Document with identical text and formatting, and yet
we have different results - i.e., "what could account for that?" And of
course there's the question of "what ought to happen?"

I don't think the OP's expectation was unreasonable. But the question
"what do I do if Word simply does not behave the way I expect/want" is not
easily answered. I suppose in the end there has to be a manual
postprocessing step and that someone would have to
a. open the output document
b. identify the paragraphs to be fixed (somehow)
c. apply the fix
d. check the results (how?!)
e. save/print when all is well


Peter Jamieson

http://tips.pjmsn.me.uk

On 22/02/2010 19:35, Doug Robbins - Word MVP wrote:
Hi Peter,

My data had not hard (line or paragraph) breaks in Excel.

I think it's a bit much to expect mail merge to multi-paragraph data and
apply such formatting.

I am not sure how real the OP's description of his requirement is, but
if it was just the static text (Line #) that was to be outdented, I
would setup the main document as a two column table with and
If...then...Else construct in each column, the one in the first column
returning the Line # if the data in the field was not blank and the one
in the second column returning the data if it was not blank.


  #14   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Seamus O'Connell Seamus O'Connell is offline
external usenet poster
 
Posts: 8
Default Mail Merge and paragraph formatting

Doug and Peter €“

Many thanks for putting in so much work on this problem.

It is a real situation, though it does not matter that much if I cant get
the result I want. Its the directory for a small charity in London. It lists
the fixed information for a person, name, address, email, phone,
qualifications, then lists any optional information they have given in none,
one, or more of four possible categories. Each line of the optional
information starts with category description then continues with the supplied
text. The document is more readable with hanging indents. But I can instead
bold the category descriptions.

My machine is an elderly PC running under XP Home + SP3. Im using Microsoft
Office Professional 2007 Version 12.0 Build 6504 (according to a system info
table).

My data has not got any paragraph marks or other breaks in the text in
Excel. The only paragraph mark is the one in the Mail merge expression.

I tried changing the paragraph formatting from Hanging to First Line indent
and the lines all ended left-justified.

Im not sure what conclusion to reach. Peter seems to have got the same
result as me, but Doug seems not to. Its no great problem if I cant do what
I want. These things start as an interesting puzzle but if youre not careful
you find yourself spiralling down a bottomless pit of diminishing returns.

Again, many thanks for all the effort youve put in, and if you do decide to
look into it further I would certainly be interested to know the results.

Apologies for not replying more promptly. I asked for notification of
replies, or at least I tried to, but Im not getting them.

Best wishes, Seamus
--
Seamus O'Connell


"Doug Robbins - Word MVP" wrote:

Hi Peter,

I just recreated my main document so that I could send it to you and
discovered something else of interest - on saving the resulting document
immediately after it was created by executing the merge (i.e. without making
any other adjustments) the mystery line was removed.

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.

"Peter Jamieson" wrote in message
...
Hi Doug,

I think it's a bit much to expect mail merge to multi-paragraph data and
apply such formatting.


Without further input from the OP, I certainly wouldn't want to spend any
more time on it.

What specifically interested me was that both you and I seem to have set
up or Mail Merge Main Document with identical text and formatting, and yet
we have different results - i.e., "what could account for that?" And of
course there's the question of "what ought to happen?"

I don't think the OP's expectation was unreasonable. But the question
"what do I do if Word simply does not behave the way I expect/want" is not
easily answered. I suppose in the end there has to be a manual
postprocessing step and that someone would have to
a. open the output document
b. identify the paragraphs to be fixed (somehow)
c. apply the fix
d. check the results (how?!)
e. save/print when all is well


Peter Jamieson

http://tips.pjmsn.me.uk

On 22/02/2010 19:35, Doug Robbins - Word MVP wrote:
Hi Peter,

My data had not hard (line or paragraph) breaks in Excel.

I think it's a bit much to expect mail merge to multi-paragraph data and
apply such formatting.

I am not sure how real the OP's description of his requirement is, but
if it was just the static text (Line #) that was to be outdented, I
would setup the main document as a two column table with and
If...then...Else construct in each column, the one in the first column
returning the Line # if the data in the field was not blank and the one
in the second column returning the data if it was not blank.


.

  #15   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Seamus O'Connell Seamus O'Connell is offline
external usenet poster
 
Posts: 8
Default Mail Merge and paragraph formatting

I forgot to add that the Hanging Indent worked under Office 2003. This only
came up when I moved to Office 2007. Seamus
--
Seamus O'Connell


"Seamus O'Connell" wrote:

Doug and Peter €“

Many thanks for putting in so much work on this problem.

It is a real situation, though it does not matter that much if I cant get
the result I want. Its the directory for a small charity in London. It lists
the fixed information for a person, name, address, email, phone,
qualifications, then lists any optional information they have given in none,
one, or more of four possible categories. Each line of the optional
information starts with category description then continues with the supplied
text. The document is more readable with hanging indents. But I can instead
bold the category descriptions.

My machine is an elderly PC running under XP Home + SP3. Im using Microsoft
Office Professional 2007 Version 12.0 Build 6504 (according to a system info
table).

My data has not got any paragraph marks or other breaks in the text in
Excel. The only paragraph mark is the one in the Mail merge expression.

I tried changing the paragraph formatting from Hanging to First Line indent
and the lines all ended left-justified.

Im not sure what conclusion to reach. Peter seems to have got the same
result as me, but Doug seems not to. Its no great problem if I cant do what
I want. These things start as an interesting puzzle but if youre not careful
you find yourself spiralling down a bottomless pit of diminishing returns.

Again, many thanks for all the effort youve put in, and if you do decide to
look into it further I would certainly be interested to know the results.

Apologies for not replying more promptly. I asked for notification of
replies, or at least I tried to, but Im not getting them.

Best wishes, Seamus
--
Seamus O'Connell


"Doug Robbins - Word MVP" wrote:

Hi Peter,

I just recreated my main document so that I could send it to you and
discovered something else of interest - on saving the resulting document
immediately after it was created by executing the merge (i.e. without making
any other adjustments) the mystery line was removed.

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.

"Peter Jamieson" wrote in message
...
Hi Doug,

I think it's a bit much to expect mail merge to multi-paragraph data and
apply such formatting.

Without further input from the OP, I certainly wouldn't want to spend any
more time on it.

What specifically interested me was that both you and I seem to have set
up or Mail Merge Main Document with identical text and formatting, and yet
we have different results - i.e., "what could account for that?" And of
course there's the question of "what ought to happen?"

I don't think the OP's expectation was unreasonable. But the question
"what do I do if Word simply does not behave the way I expect/want" is not
easily answered. I suppose in the end there has to be a manual
postprocessing step and that someone would have to
a. open the output document
b. identify the paragraphs to be fixed (somehow)
c. apply the fix
d. check the results (how?!)
e. save/print when all is well


Peter Jamieson

http://tips.pjmsn.me.uk

On 22/02/2010 19:35, Doug Robbins - Word MVP wrote:
Hi Peter,

My data had not hard (line or paragraph) breaks in Excel.

I think it's a bit much to expect mail merge to multi-paragraph data and
apply such formatting.

I am not sure how real the OP's description of his requirement is, but
if it was just the static text (Line #) that was to be outdented, I
would setup the main document as a two column table with and
If...then...Else construct in each column, the one in the first column
returning the Line # if the data in the field was not blank and the one
in the second column returning the data if it was not blank.




  #16   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Mail Merge and paragraph formatting

Have you actually executed the merge to a new document?

It turned out that Peter was only previewing the results and in this case,
the preview does NOT show you what the result will look like.

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.

"Seamus O'Connell" wrote in
message ...
I forgot to add that the Hanging Indent worked under Office 2003. This only
came up when I moved to Office 2007. Seamus
--
Seamus O'Connell


"Seamus O'Connell" wrote:

Doug and Peter €“

Many thanks for putting in so much work on this problem.

It is a real situation, though it does not matter that much if I cant
get
the result I want. Its the directory for a small charity in London. It
lists
the fixed information for a person, name, address, email, phone,
qualifications, then lists any optional information they have given in
none,
one, or more of four possible categories. Each line of the optional
information starts with category description then continues with the
supplied
text. The document is more readable with hanging indents. But I can
instead
bold the category descriptions.

My machine is an elderly PC running under XP Home + SP3. Im using
Microsoft
Office Professional 2007 Version 12.0 Build 6504 (according to a system
info
table).

My data has not got any paragraph marks or other breaks in the text in
Excel. The only paragraph mark is the one in the Mail merge expression.

I tried changing the paragraph formatting from Hanging to First Line
indent
and the lines all ended left-justified.

Im not sure what conclusion to reach. Peter seems to have got the same
result as me, but Doug seems not to. Its no great problem if I cant do
what
I want. These things start as an interesting puzzle but if youre not
careful
you find yourself spiralling down a bottomless pit of diminishing
returns.

Again, many thanks for all the effort youve put in, and if you do decide
to
look into it further I would certainly be interested to know the results.

Apologies for not replying more promptly. I asked for notification of
replies, or at least I tried to, but Im not getting them.

Best wishes, Seamus
--
Seamus O'Connell


"Doug Robbins - Word MVP" wrote:

Hi Peter,

I just recreated my main document so that I could send it to you and
discovered something else of interest - on saving the resulting
document
immediately after it was created by executing the merge (i.e. without
making
any other adjustments) the mystery line was removed.

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my
services on
a paid professional basis.

"Peter Jamieson" wrote in message
...
Hi Doug,

I think it's a bit much to expect mail merge to multi-paragraph
data and
apply such formatting.

Without further input from the OP, I certainly wouldn't want to spend
any
more time on it.

What specifically interested me was that both you and I seem to have
set
up or Mail Merge Main Document with identical text and formatting,
and yet
we have different results - i.e., "what could account for that?" And
of
course there's the question of "what ought to happen?"

I don't think the OP's expectation was unreasonable. But the question
"what do I do if Word simply does not behave the way I expect/want"
is not
easily answered. I suppose in the end there has to be a manual
postprocessing step and that someone would have to
a. open the output document
b. identify the paragraphs to be fixed (somehow)
c. apply the fix
d. check the results (how?!)
e. save/print when all is well


Peter Jamieson

http://tips.pjmsn.me.uk

On 22/02/2010 19:35, Doug Robbins - Word MVP wrote:
Hi Peter,

My data had not hard (line or paragraph) breaks in Excel.

I think it's a bit much to expect mail merge to multi-paragraph data
and
apply such formatting.

I am not sure how real the OP's description of his requirement is,
but
if it was just the static text (Line #) that was to be outdented, I
would setup the main document as a two column table with and
If...then...Else construct in each column, the one in the first
column
returning the Line # if the data in the field was not blank and the
one
in the second column returning the data if it was not blank.



  #17   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Mail Merge and paragraph formatting

And, if you cannot get it to work, the other way to set up your main
document would be as a two column table with the name, address, email,
phone, qualifications headings in the first column, and the merge fields in
the second column then also in that column a series of If...then...Else
constructions to insert each of the other categories and corresponding
If...then...Else constructions in the second column for the data.

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.

"Seamus O'Connell" wrote in
message ...
I forgot to add that the Hanging Indent worked under Office 2003. This only
came up when I moved to Office 2007. Seamus
--
Seamus O'Connell


"Seamus O'Connell" wrote:

Doug and Peter €“

Many thanks for putting in so much work on this problem.

It is a real situation, though it does not matter that much if I cant
get
the result I want. Its the directory for a small charity in London. It
lists
the fixed information for a person, name, address, email, phone,
qualifications, then lists any optional information they have given in
none,
one, or more of four possible categories. Each line of the optional
information starts with category description then continues with the
supplied
text. The document is more readable with hanging indents. But I can
instead
bold the category descriptions.

My machine is an elderly PC running under XP Home + SP3. Im using
Microsoft
Office Professional 2007 Version 12.0 Build 6504 (according to a system
info
table).

My data has not got any paragraph marks or other breaks in the text in
Excel. The only paragraph mark is the one in the Mail merge expression.

I tried changing the paragraph formatting from Hanging to First Line
indent
and the lines all ended left-justified.

Im not sure what conclusion to reach. Peter seems to have got the same
result as me, but Doug seems not to. Its no great problem if I cant do
what
I want. These things start as an interesting puzzle but if youre not
careful
you find yourself spiralling down a bottomless pit of diminishing
returns.

Again, many thanks for all the effort youve put in, and if you do decide
to
look into it further I would certainly be interested to know the results.

Apologies for not replying more promptly. I asked for notification of
replies, or at least I tried to, but Im not getting them.

Best wishes, Seamus
--
Seamus O'Connell


"Doug Robbins - Word MVP" wrote:

Hi Peter,

I just recreated my main document so that I could send it to you and
discovered something else of interest - on saving the resulting
document
immediately after it was created by executing the merge (i.e. without
making
any other adjustments) the mystery line was removed.

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my
services on
a paid professional basis.

"Peter Jamieson" wrote in message
...
Hi Doug,

I think it's a bit much to expect mail merge to multi-paragraph
data and
apply such formatting.

Without further input from the OP, I certainly wouldn't want to spend
any
more time on it.

What specifically interested me was that both you and I seem to have
set
up or Mail Merge Main Document with identical text and formatting,
and yet
we have different results - i.e., "what could account for that?" And
of
course there's the question of "what ought to happen?"

I don't think the OP's expectation was unreasonable. But the question
"what do I do if Word simply does not behave the way I expect/want"
is not
easily answered. I suppose in the end there has to be a manual
postprocessing step and that someone would have to
a. open the output document
b. identify the paragraphs to be fixed (somehow)
c. apply the fix
d. check the results (how?!)
e. save/print when all is well


Peter Jamieson

http://tips.pjmsn.me.uk

On 22/02/2010 19:35, Doug Robbins - Word MVP wrote:
Hi Peter,

My data had not hard (line or paragraph) breaks in Excel.

I think it's a bit much to expect mail merge to multi-paragraph data
and
apply such formatting.

I am not sure how real the OP's description of his requirement is,
but
if it was just the static text (Line #) that was to be outdented, I
would setup the main document as a two column table with and
If...then...Else construct in each column, the one in the first
column
returning the Line # if the data in the field was not blank and the
one
in the second column returning the data if it was not blank.



  #18   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Seamus O'Connell Seamus O'Connell is offline
external usenet poster
 
Posts: 8
Default Mail Merge and paragraph formatting

Doug -

Gosh. It works. Wish I'd thought of that in the first place.

Many thanks, Seamus

--
Seamus O'Connell


"Doug Robbins - Word MVP" wrote:

Have you actually executed the merge to a new document?

It turned out that Peter was only previewing the results and in this case,
the preview does NOT show you what the result will look like.

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.


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
Creating Conditional Paragraph Breaks With Mail Merge SamuelT Mailmerge 3 September 26th 08 12:23 PM
Paragraph formatting w/Mail Merge Asinger Mailmerge 8 August 15th 07 09:03 AM
Mail Merge fields merge with different formatting KP Microsoft Word Help 1 February 22nd 06 01:01 PM
Formatting merge fields: inserting a paragraph mark before a field Justin Cascio Mailmerge 1 August 30th 05 08:18 PM
can you insert a paragraph into a mail merge letter mnm_nut Mailmerge 1 February 18th 05 10:17 PM


All times are GMT +1. The time now is 06:31 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"