Para master semua met pagi, saya membuat mailmerge excel+word dan berhasil, kemudian saya coba memanggil file word tersebut dengan code vba sbb:
Private Sub CmdMerge_Click() Dim WordApp As Object Dim wrdDoc As Object Dim tmpDoc As Object Dim WDoc As String Dim myDoc As String myDoc = "TestDoc" WDoc = ThisWorkbook.path & "\" & myDoc & ".docx" On Error Resume Next Set WordApp = GetObject(, "Word.Application") If WordApp Is Nothing Then Set WordApp = CreateObject("Word.application") Set wrdDoc = WordApp.Documents.Open(WDoc) WordApp.Visible = True Else For Each tmpDoc In WordApp.Documents If StrComp(tmpDoc.FullName, WDoc, vbTextCompare) = 0 Then Set wrdDoc = tmpDoc Exit For End If Next If wrdDoc Is Nothing Then Set wrdDoc = WordApp.Documents.Open(WDoc) End If End If WordApp.Activate End Sub
file tersebut berhasil dibuka, hanya saja "mailings" di dokumen tidak aktif. Pertanyaannya:
- Bisakah mailings aktif ketika ms word dipanggil dan terbuka?
- Apakah code yg saya masukkan tersebut kurang sehingga mailings tidak aktif?
thanks