Is there a way to set the record Delimiter

M

Mike

I want to change the record Delimiter in a mail merge in
word. I know if I change it in my datasource file and
open it with the MailMerge.OpenDataSource command in VB it
puts up the Dialog Titled "Header Record Delimiters"
asking me to change the Field and Record Delimiters. Can
I set these two Delimiters in Word 2000 or greater before
I call the MailMerge.OpenDataSource in vb so the dialog
will not show up? This is an issue for me because one of
my field need to contain a cr and a lf in it. I tried
putting the cr and lf inside quotes. That work except that
the quotes also showed up in the merged doc

Example
Public Sub AddCCToList(sCC As String)
If (Len(msCCList) > 0) Then
msCCList = msCCList & Chr(34) & Chr(13) & Chr(10)
& Chr(34) & sCC
Else
msCCList = sCC
End If
End Sub

Gave me the results

Jim Hays"
"Greg Scott

thanks

Mike
 
P

Peter Jamieson

I don't think there is a way, at least not directly. It's possible to set
the field delimiter (and it may be possible to set the "text delimiter" for
ODBC connections using entries in a SCHEMA.INI file, but as far as I know
ODBC relies on the record delmiter being CRLF.
This is an issue for me because one of
my field need to contain a cr and a lf in it. I tried
putting the cr and lf inside quotes.

Are you just putting the CR and/or LF inside quotes, or the entire field?
 
G

Guest

I am not using ODBC, I am passing a path to a file in the
MailMerge.OpenDataSource call. If I can't change the
record delimiter then what is wrong with the way I am
using the quotes to tell Word Merge to skip over the CRLF?
Why does it show the quotes in the merged doc?

Mike
 
P

Peter Jamieson

Just quoting the carriage returns isn't going to work.

Quoting the entire field with carrage returns might work, but I wouldn't
guarantee it.

e.g. if your record contains

field1,field2line1
field2line2,field3

you have

field1,field2line1"
"field2line2,field3

butyou probably need

field1,"field2line1
field2line2",field3
 

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