M
Microsoft
I'm new to the list and a novice at vba so I hope this is clear...Thanks in
advance.
I have some doc. templates with vb code that brings in data from a .csv,
names and saves the doc. In word 2003 i am getting a new dialog...
'opening this document will run the following sql command
select * from C:\Program Files\Filemaker\etc\TempleteMerge.mer
Data from you database will be placed in the document. Do you want to
continue?'
Is there any way to supress it...
here's the code:
Sub AutoNew()
Open "C:\Program Files\Filemaker\templetmerge.csv" For Input As #1
Input #1, ClientName, Sal, First, Last, Lbl_Address, Lbl_addressee,
FileDate, _
FileSubject, FileNameID, FileSaveLoc, FileSubDir, ApptDate, ApptTime, Plan,
PlanNbr
Close #1
ActiveDocument.MailMerge.OpenDataSource _
Name:="C:\Program Files\Filemaker\TempleteMerge.mer"
ActiveDocument.MailMerge.ViewMailMergeFieldCodes = wdtogglefieldcodes
ActiveDocument.Fields.Update
ActiveDocument.MailMerge.MainDocumentType = wdNotAMergeDocument
ActiveDocument.SaveAs FileName:=FileSaveLoc & "\" & FileNameID & ".doc"
ActiveDocument.Versions.Save Comment:="Company: " & ClientName & Chr(10) &
"letter to: " & First & _
" " & Last & Chr(10) & " Subject: " & FileSubject & Chr(10) & " Date: " &
FileDate
ActiveDocument.BuiltInDocumentProperties(wdPropertyTitle) = FileSubDir & "
Letter"
ActiveDocument.BuiltInDocumentProperties(wdPropertySubject) = FileSubject
ActiveDocument.BuiltInDocumentProperties(wdPropertyCompany) = ClientName
ActiveDocument.BuiltInDocumentProperties(wdPropertyComments) = "Sent on: " _
& FileDate & Chr(10) & " TO: " & First & " " & Last
End Sub
advance.
I have some doc. templates with vb code that brings in data from a .csv,
names and saves the doc. In word 2003 i am getting a new dialog...
'opening this document will run the following sql command
select * from C:\Program Files\Filemaker\etc\TempleteMerge.mer
Data from you database will be placed in the document. Do you want to
continue?'
Is there any way to supress it...
here's the code:
Sub AutoNew()
Open "C:\Program Files\Filemaker\templetmerge.csv" For Input As #1
Input #1, ClientName, Sal, First, Last, Lbl_Address, Lbl_addressee,
FileDate, _
FileSubject, FileNameID, FileSaveLoc, FileSubDir, ApptDate, ApptTime, Plan,
PlanNbr
Close #1
ActiveDocument.MailMerge.OpenDataSource _
Name:="C:\Program Files\Filemaker\TempleteMerge.mer"
ActiveDocument.MailMerge.ViewMailMergeFieldCodes = wdtogglefieldcodes
ActiveDocument.Fields.Update
ActiveDocument.MailMerge.MainDocumentType = wdNotAMergeDocument
ActiveDocument.SaveAs FileName:=FileSaveLoc & "\" & FileNameID & ".doc"
ActiveDocument.Versions.Save Comment:="Company: " & ClientName & Chr(10) &
"letter to: " & First & _
" " & Last & Chr(10) & " Subject: " & FileSubject & Chr(10) & " Date: " &
FileDate
ActiveDocument.BuiltInDocumentProperties(wdPropertyTitle) = FileSubDir & "
Letter"
ActiveDocument.BuiltInDocumentProperties(wdPropertySubject) = FileSubject
ActiveDocument.BuiltInDocumentProperties(wdPropertyCompany) = ClientName
ActiveDocument.BuiltInDocumentProperties(wdPropertyComments) = "Sent on: " _
& FileDate & Chr(10) & " TO: " & First & " " & Last
End Sub