Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / September 2004

Tip: Looking for answers? Try searching our database.

How do I select the delimiter for a mail merge?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robin Tucker - 29 Sep 2004 12:59 GMT
Hi,

I'm using a flat text file (comma delimited) as a merge source.  How can I
set the delimiter to use for the mail merge without Word asking me when I
set the data source?

ie. at present I write this code (shown below), however, word sometimes asks
me what I wish to use as the delimiter.  This is true when there is just one
column in the merge data source text file.  Can I set this manually using
VBA?

Thanks

' Setup the merge type.

theDocument.MailMerge.MainDocumentType = WdMailMergeMainDocType.wdCatalog

' and open the data source.

theDocument.MailMerge.OpenDataSource( _
                                               Name:=m_MergeFileName, _
                                               ConfirmConversions:=False, _
                                               ReadOnly:=False, _
                                               LinkToSource:=False, _
                                               AddToRecentFiles:=False, _
                                               PasswordDocument:="", _
                                               PasswordTemplate:="", _
                                               WritePasswordDocument:="", _
                                               WritePasswordTemplate:="", _
                                               Revert:=False, _
                                               Format:=Word.WdOpenFormat.wdOpenFormatAuto,
_
                                               Connection:="", _
                                               SQLStatement:="", _
                                               SQLStatement1:="")

' Destination to new document.

theDocument.MailMerge.Destination =
Word.WdMailMergeDestination.wdSendToNewDocument

' Don't copy over blank items.

theDocument.MailMerge.SuppressBlankLines = True
Peter Jamieson - 29 Sep 2004 14:23 GMT
No, the only way you have a chance of doing it is to connect using ODBC and
specify the delimiter for the file you want to open in the SCHEMA.INI file
in th eappropriate directory.

Signature

Peter Jamieson

> Hi,
>
[quoted text clipped - 26 lines]
>                                                 WritePasswordTemplate:="", _
>                                                 Revert:=False, _

Format:=Word.WdOpenFormat.wdOpenFormatAuto,
> _
>                                                 Connection:="", _
[quoted text clipped - 9 lines]
>
> theDocument.MailMerge.SuppressBlankLines = True

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.