0
我有以下代碼來執行郵件合併使用VBA,郵件合併執行後Word文檔打開最小化,是否有辦法打開正常的文檔(最大化)?Word文檔打開後郵件合併使用msaccess最小化
Dim DocName As String
Echo -1, "Merge in progress..."
Dim templateName As String, tempRoot As String
tempRoot = "c:\temp\mailmerge"
templateName = tempRoot & "CertificateRSZDutch.dotx"
Dim objDoc As Word.Document
Dim objWord As New Word.Application
Set objDoc = objWord.Documents.Open(templateName)
objWord.Visible = True
DoCmd.TransferText acExportDelim, , "Mailmerge_CertificateRSZDutch", "Q:\jas\hr\mailmerge\LES\CertificateRSZDutch.txt", True
objDoc.MailMerge.OpenDataSource Name:= _
tempRoot & "CertificateRSZDutch.txt", ConfirmConversions:=False, ReadOnly _
:=False, LinkToSource:=True, AddToRecentFiles:=False, PasswordDocument:= _
"", PasswordTemplate:="", WritePasswordDocument:="", _
WritePasswordTemplate:="", Revert:=False, Format:=wdOpenFormatAuto, _
Connection:="", SQLStatement:="", SQLStatement1:="", SubType:= _
wdMergeSubTypeOther
objDoc.MailMerge.Execute
objDoc.Close False
objWord.ActiveDocument.SaveAs tempRoot & "CertificateRSZ.docx"
Set objDoc = objWord.Documents.Open(Filename:=tempRoot & "CertificateRSZ.docx")
Set objWord = Nothing
Set objDoc = Nothing
感謝
請使用代碼按鈕 - {}來設置您的文章的格式。 – Fionnuala