I have use this code for opening a word document, but when the Word Document started, it "forgot" mail merge process which I set on document.
How to set a code under button on my form to open a word document and to NOT forget a Mail Merge process. The best option could be to automatically open a Mail Merge Tab on Word document.
If somebody could help me, I'd really appreciate that. I find in my seeking for better option some bookmarks mailing or automation, but I couldn't develop that on myself, but if somebody know coding for that it will be maybe better idea.
Option Compare Database
Option Explicit
Private Sub Command205_Click()
Dim LWordDoc As String
Dim oApp As Object
LWordDoc = "Z:\Razmena\Andra\4.1.1. - WORK ORDER LISTA - RADNA.docx"
If Dir(LWordDoc) = "" Then
MsgBox "Document not found."
Else
Set oApp = CreateObject(Class:="Word.Application")
oApp.Visible = True
oApp.Activate
oApp.WindowState = wdWindowStateMaximize
oApp.Documents.Open FileName:=LWordDoc
End If
End Sub