A
alamas
hi!
Automation mailmerge with next vb code:
g_objWord.Documents.Ope
FileName:=GetTitleFromFilename(g_strFileTemplate)
g_objWord.ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
g_objWord.ActiveDocument.MailMerge..OpenDataSource Name:=sDataFile
g_objWord.Options.UpdateLinksAtPrint = True
g_objWord.Options.UpdateFieldsAtPrint = True
With g_objWord.ActiveDocument
.MailMerge.SuppressBlankLines = False
.MailMerge.Destination = 1 '= wdSendToPrinter
.MailMerge.DataSource.FirstRecord = 1
.MailMerge.DataSource.LastRecord = -16
.MailMerge.Execute
.Close 0
End With
'*************************************************
the template has a table. I need adjust the dimensions of cells in m
table to reflect the data that is in them.
It works correctly when:
- mailmerge to a new document.(Manually or with this code)
- mailmerge to printer.(Manually)
I want to send the document to a printer.
Thanks
Automation mailmerge with next vb code:
g_objWord.Documents.Ope
FileName:=GetTitleFromFilename(g_strFileTemplate)
g_objWord.ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
g_objWord.ActiveDocument.MailMerge..OpenDataSource Name:=sDataFile
g_objWord.Options.UpdateLinksAtPrint = True
g_objWord.Options.UpdateFieldsAtPrint = True
With g_objWord.ActiveDocument
.MailMerge.SuppressBlankLines = False
.MailMerge.Destination = 1 '= wdSendToPrinter
.MailMerge.DataSource.FirstRecord = 1
.MailMerge.DataSource.LastRecord = -16
.MailMerge.Execute
.Close 0
End With
'*************************************************
the template has a table. I need adjust the dimensions of cells in m
table to reflect the data that is in them.
It works correctly when:
- mailmerge to a new document.(Manually or with this code)
- mailmerge to printer.(Manually)
I want to send the document to a printer.
Thanks