C
Curt
for some reason beyond me the following macro duplicates the data from the
text file when createing new document. I have removed the Selection.Type
Paragraph line to no avail where duplicated. Iam sending this to a new doc to
keep from printing till it works ok. the printing part is (') out from net
search.
Thanks for any help greatful
Sub Macro1()
' Macro recorded 5/31/2008 by Curtiss A. Greer
Selection.MoveDown Unit:=wdLine, count:=1
Selection.InsertDateTime DateTimeFormat:="MMMM d, yyyy", InsertAsField:= _
True, DateLanguage:=wdEnglishUS, CalendarType:=wdCalendarWestern, _
InsertAsFullWidth:=False
Selection.TypeParagraph
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:= _
"Name_of_Entry"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:= _
"Contact_Person"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:= _
"Address"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:= _
"CityState"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:="Zip_"
Selection.TypeParagraph
Selection.TypeParagraph
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
'ActiveDocument.MailMerge.Destination = wdSendToNewDocument
'ActiveDocument.PrintOut Background:=False
'ActiveDocument.Close wdDoNotSaveChanges
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = False
With .datasource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
End With
ActiveWindow.Close
CommandBars("Stop Recording").Visible = False
End Sub
text file when createing new document. I have removed the Selection.Type
Paragraph line to no avail where duplicated. Iam sending this to a new doc to
keep from printing till it works ok. the printing part is (') out from net
search.
Thanks for any help greatful
Sub Macro1()
' Macro recorded 5/31/2008 by Curtiss A. Greer
Selection.MoveDown Unit:=wdLine, count:=1
Selection.InsertDateTime DateTimeFormat:="MMMM d, yyyy", InsertAsField:= _
True, DateLanguage:=wdEnglishUS, CalendarType:=wdCalendarWestern, _
InsertAsFullWidth:=False
Selection.TypeParagraph
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:= _
"Name_of_Entry"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:= _
"Contact_Person"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:= _
"Address"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:= _
"CityState"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:="Zip_"
Selection.TypeParagraph
Selection.TypeParagraph
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
'ActiveDocument.MailMerge.Destination = wdSendToNewDocument
'ActiveDocument.PrintOut Background:=False
'ActiveDocument.Close wdDoNotSaveChanges
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = False
With .datasource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
End With
ActiveWindow.Close
CommandBars("Stop Recording").Visible = False
End Sub