Bypassing the "Confirm Data Source" box when running macro

  • Thread starter Jadie Wheeler via AdminLife
  • Start date
J

Jadie Wheeler via AdminLife

I have created the following macro to use within a letter, tryingto make it as effortless for our users as possible. The problemis when you go to run the macro you are prompted by the ConfirmData Source box everytime. Is there a way to add code into theOpenDataSource part of the macro that recognizes the followingsteps, so the user doesn't have to do this everytime?:

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

************************************************************************************************
Sub ADINC()
'
' ADINC Macro
' Macro recorded 5/18/2004 by jwheeler
'
ActiveDocument.MailMerge.OpenDataSource Name:= _
"C:\Documents andSettings\jwheeler\Desktop\ADINC_JWHEELER_CQO", _
ConfirmConversions:=False, ReadOnly:=False,LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="",PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="",Revert:=False, _
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
 
C

Cindy M -WordMVP-

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()
'
' ADINC Macro
' Macro recorded 5/18/2004 by jwheeler
'
ActiveDocument.MailMerge.OpenDataSource Name:=
"C:\Documents and Settings\jwheeler\Desktop\ADINC JWHEELER CQO",
ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True,
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="",
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False,
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 :)
 

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