Hi all
I have an Acess form that is filled out and when a button is clicked populates into a word document is there a way to make this process automated so it automatically prints and closes the word document (without saving)
Obviously there is more details thats just the basics
I have an Acess form that is filled out and when a button is clicked populates into a word document is there a way to make this process automated so it automatically prints and closes the word document (without saving)
Code:
Public Function FUNC_CreateEnvelope()
'FIND WORD FILE
Dim oWd As Object 'Word.Application
Dim oDoc As Object 'Word.Document
Dim bm As Object 'Word.Bookmark
'Set oWd = New Word.Application
Set oWd = CreateObject("Word.Application")
Set oDoc = oWd.Documents.Add("C:/Word Documents\FormTemplate.docx")
'CUSTOMER ENTRY
Set bm = oDoc.Bookmarks("C5CustomerName")
bm.Range.Text = UCase([Forms]![FRM_TBLALL_FullDetails]![SSFRM_TBLALL_OrderDetails].[Form]![CmbCustomerNo].Column(0) & " " _
& [Forms]![FRM_TBLALL_FullDetails]![SSFRM_TBLALL_OrderDetails].[Form]![CmbCustomerName].Column(2) & "")
oWd.Visible = True
End Function
Obviously there is more details thats just the basics