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
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