pulseaussie.blogg.se

Run a mail merge leter in word for mac
Run a mail merge leter in word for mac










run a mail merge leter in word for mac

I see two possible solutions for that:ġ) You can save the original document as a real template. Unfortunately the final document generated by the Mail Merge do not hold the name of the original file anywhere. RetVal = ShellExecute(0, "open", "M:\gendoc\FG_To_ECF.exe", ActiveDocument.Name, "c:\Certificates", SW_SHOWNORMAL) (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _īyVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

run a mail merge leter in word for mac

Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _ In the example you gave the code would as below: Const SW_SHOW = 5

#RUN A MAIL MERGE LETER IN WORD FOR MAC FULL#

If you are trying to retrieve the file name of the current Word document that is open, you must use ActiveDocument.FullName (which includes the full path) or ActiveDocument.Name (just the file name including its extension). I am not sure if I understood correctly your question. RetVal = ShellExecute(0, "open", "M:\gendoc\FG_To_ECF.exe", _ĭoc_Name, "c:\Certificates", SW_SHOWNORMAL) ' rather than name of Word document template ' The line below retrieves name, "FORM LETTER"(strips off. Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _īyVal hwnd As Long, ByVal lpOperation As String, _īyVal lpFile As String, ByVal lpParameters As String, _īyVal lpDirectory As String, ByVal nShowCmd As Long) As Long Is there a way to get the Word document (template) name in VBA code after the document has merged? I know Word changes the name after it merges, I need the Word document name that contains the merge fields. When I query the active document it is called, "Form Letters." This works, however the parameter I need is the name of the Word document. Here is my scenario: User merges a Word document, I have a button on the Quick Access toolbar which execute a macro which uses a Shell Execute to spawn an application passing it a parameter.












Run a mail merge leter in word for mac