Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mailmerge - suppressing my spaces

Status
Not open for further replies.

MikeL91

Programmer
Feb 8, 2001
100
US
Help!

I received a print ready dbase file with fields called line01, line02 etc. on some of these the data is indented a few charaters with spaces to line up some totals. mailmerge is stripping off the leading spaces, how do I change that?


thanks in advance
 
Hi,

Would it help to RIGHT JUSTIFY those fields?

...and maybe ALSO change the FONT to a FIXED FONT like Courier New???

Skip,

[red]Be advised:[/red] [glasses]
Alcohol and Calculus do not mix!
If you drink, don't derive! [tongue]
 
I am using courier, and unfortunatly right justtfication real makes it worse. I have it so it shows spaces as periods on screen, and it seems like it's alltriming the field as it brings the data in because I dont see the periods at all.
 
See if this will work...

ALT+F9 to toggle field codes ON
Add \* MERGEFORMAT to end of the merge fields (within the right curly bracket)
Should look like
Code:
{ line01 \* MERGEFORMAT }
{ line02 \* MERGEFORMAT }
Merge to see if it left in the leading spaces

If you have lots of fields to which you want to add \* MERGEFORMAT, use the following code...
Code:
With Selection.Find
    .ClearFormatting
    Do While .Execute(FindText:="^d", Forward:=True, _
            Format:=True) = True
    'Selection.Find.Execute
    Selection.MoveRight Unit:=wdCharacter, Count:=1
    Selection.MoveLeft Unit:=wdCharacter, Count:=1
    Selection.TypeText Text:="\* MERGEFORMAT "
    Selection.MoveRight Unit:=wdCharacter, Count:=1
    Loop
End With
Make sure your fields codes are visible (ALT+F9) before you run the macro or it will not work.

HTH
 
This problem sounds as if the data are numeric. If so, putting a numeric picture switch into the MERGEFIELD can be used to restore\insert leading and/or trailing 0s and/or spaces.

Suppose, for example your MERGEFIELD is:
{MERGEDIELD line01}
and line01 has a value of 1.5. If you want to make sure that line01 will be displayed as ' 1.5 ', change the MERGEFIELD to:
{MERGEDIELD line01 \# ###.##}
Similarly, to make sure that line01 will be displayed as ' 1.50', change the MERGEFIELD to:
{MERGEDIELD line01 \# ###.00}
Or, to make sure that line01 will be displayed as '01.5', change the MERGEFIELD to:
{MERGEDIELD line01 \# 00.0}
and so on.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top