Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.
Private Sub cmdMergeIT_Click() DoCmd.SetWarnings False DoCmd.OpenQuery "Art Docket Recommendations Word", acViewNormal DoCmd.SetWarnings True 'For use as TEMPLATE Dim objApp As Word.Application 'For use as TEMPLATE Dim objWord As Word.Document ' Dim ObjWord2 As Word.Document ' 'For use as TEMPLATE Set objApp = New Word.Application 'For use as TEMPLATE on GRD Server - added from EE Set objWord = objApp.Documents.Add("K:\DUG\Templates\docketcharttemplate_newlayout_portrait.dot") ' Make Word visible. objWord.Application.Visible = True ' Set the mail merge data source as the DUG Access Database objWord.MailMerge.OpenDataSource _ Name:="C:\Users\HT\My Documents\Gifts\DUG.mde", _ LinkToSource:=True, _ Connection:="TABLE tblDocketRecommendations", _ SQLStatement:="SELECT * FROM [tblDocketRecommendations]" 'Execute the mail merge. objWord.MailMerge.Execute '========================================================= ' code to close mail merge doc based on template For Each ObjWord2 In objApp.Documents If ObjWord2.Name = "Document1" Then ObjWord2.Close False End If Next End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|vba code to create folders according to a hyperlink||14||41|
|VBA - Why copy area and paste area arent the same size error?||3||47|
|View SQL Count Records||3||32|
|Saving excel file with same name as word document I am getting data from||7||13|
Join the community of 500,000 technology professionals and ask your questions.