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 / May 2004

Tip: Looking for answers? Try searching our database.

Bypassing the "Confirm Data Source" box when running macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jadie Wheeler - 22 May 2004 19:43 GMT
I have created the following macro to use within a letter, trying to make it as effortless for our users as possible.  The problem is when you go to run the macro you are prompted by the Confirm Data Source box everytime.  Is there a way to add code into the OpenDataSource part of the macro that recognizes the following steps, so the user doesn't have to do this everytime?:

1.  Confirm Data Source box - check the show all box and click ok button
2.  Pick text files from list and click ok button
3.  Header Record Delimiters box - choose , for field delimiter and (enter) for record delimiter

************************************************************************************************
Sub ADINC()
'
' ADINC Macro
' Macro recorded 5/18/2004 by jwheeler
'
   ActiveDocument.MailMerge.OpenDataSource Name:= _
       "C:\Documents and Settings\jwheeler\Desktop\ADINC_JWHEELER_CQO", _
       ConfirmConversions:zlse, ReadOnly:zlse, LinkToSource:=True, _
       AddToRecentFiles:zlse, PasswordDocument:="", PasswordTemplate:="", _
       WritePasswordDocument:="", WritePasswordTemplate:="", Revert:zlse, _
       Format:=wdOpenFormatAuto, Connection:="", SQLStatement:="", SQLStatement1 _
       :="", SubType:=wdMergeSubTypeOther
   With ActiveDocument.MailMerge
       .Destination = wdSendToNewDocument
       .MailAsAttachment = False
       .MailAddressFieldName = ""
       .MailSubject = ""
       .SuppressBlankLines = True
       With .DataSource
           .FirstRecord = wdDefaultFirstRecord
           .LastRecord = wdDefaultLastRecord
       End With
       .Execute Pause:=True
   End With
End Sub
************************************************************************************************

Any help would be greatly appreciated.

TIA
--------------------------------
From: Jadie Wheeler

-----------------------
Posted by a user from AdminLife (http://www.adminlife.com/)

<Id>jDV+gn5O70SmWyOSk0z60A==</Id
Cindy M  -WordMVP- - 24 May 2004 15:38 GMT
Hi Jadie,

Which version of Word? What is the data source type? You mention something about text
files, but I don't see any file extension for the file name in your code sample.

If this is a text file, what field and record delimiters does it use?

It looks to me like Word isn't recognizing the file type properly. If you turn on the
display of file extensions, then record the OpenDataSource in a macro, does this work
any better?

> I have created the following macro to use within a letter, trying to make it as effortless for our users as possible.  The problem is when you go to run the macro
you are prompted by the Confirm Data Source box everytime.  Is there a way to add
code into the OpenDataSource part of the macro that recognizes the following steps,
so the user doesn't have to do this everytime?:
>  
> 1.  Confirm Data Source box - check the show all box and click ok button
> 2.  Pick text files from list and click ok button
> 3.  Header Record Delimiters box - choose , for field delimiter and (enter) for record delimiter
>  

*************************************************************************************
***********
> Sub ADINC()
> '
[quoted text clipped - 8 lines]
>         Format:=wdOpenFormatAuto, Connection:="", SQLStatement:="", SQLStatement1  
>         :="", SubType:=wdMergeSubTypeOther

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in
the newsgroup and not by e-mail :-)
 
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.