View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default Text file data source problem. Not recognizing tabs.

Hi Jef,

You can do this without a macro. Simply:
.. open the mailmerge main document
.. press Alt-F9 to expose the field codes
.. Use Find/Replace with:
. 'MERGEFIELD *_Perc' for the 'Find' text
. '^& ^92# $,0.00' for the 'Replace' text
. 'Use wildcards' checked
.. press Alt-F9 again to hide the field codes
.. save the mailmerge main document
.. run your mailmerge.

You'll note that I've used '\# $,0.00' as the formatting switch, instead of '\# $#,###.00' as you proposed. The reason for doing
this is that your rendition of the switch pads all values of less than $1,000 with spaces after the '$' and could lead to '$0.50',
for example, being displayed as '$ .50' (ie no '0' before the cents).

--
Cheers
macropod
[MVP - Microsoft Word]


"Jelmore" wrote in message ...
This is for Word 2003. I have a mail merge document that uses a
tab-separated text file as the data source. The text file looks something
like this:
Id Fname Lname address
01 John Doe 123 Fake St.
02 Joe Six-Pack 123 Fake St.

When creating the merge file, I specify the data source as an OLE DB
Database File (at the Confirm Data Source window), and then indicate that the
field delimiter is Tab. This merge file seems to work fine on all the
computers in the office except for one. On this one computer, Word isn't
breaking the fields up as it should. Instead, it's combining all the fields
in each record into a single field. So instead of seeing 4 fields (Id,
Fname, Lname, and address), it sees a single field named
Id_Fname_Lname_address. Obviously Word can't find that single field in the
data source, and the merge fails. The merge was working on this computer as
recently as a couple weeks ago, and I don't know what could have changed. Is
there some setting that the user could have inadvertently changed that would
cause this? Any ideas at all? Thanks.