I'm trying to do the following:
From Access create a Word document and save it as a .docx.
What I have so far:
From Access I have a command button to create a Word Document based off a query.
Then once the Word template opens you click "Yes" to allow the command to run.
The Word doc opens with the title of the template. "PA_Template.docm"
I want a button on the Word doc to Save As to a .docx and not save the command button.
How do it to that?
The code in my MS Word command button is this:
From Access create a Word document and save it as a .docx.
What I have so far:
From Access I have a command button to create a Word Document based off a query.
Code:
Private Sub Command47_Click()
DoCmd.SetWarnings False
DoCmd.OpenQuery "Q_PlanningAgreementforMakeTable", acViewNormal, acEdit
DoCmd.SetWarnings True
' This opens the Word file. The 1 at the end makes sure it is visible.
Shell "winword ""C:\Users\brweekley\Documents\Databases\Project Database SFC\PA_Template.docm""", 1
End Sub
Then once the Word template opens you click "Yes" to allow the command to run.
The Word doc opens with the title of the template. "PA_Template.docm"
I want a button on the Word doc to Save As to a .docx and not save the command button.
How do it to that?
The code in my MS Word command button is this:
Code:
Private Sub CommandButton1_Click()
'Application.FileDialog(msoFileDialogSaveAs).Show
With Application.FileDialog(msoFileDialogSaveAs)
.FilterIndex = 2 '.docm file format
.Show
If .SelectedItems.Count <> 0 Then
ThisDocument.SaveAs2 .SelectedItems(1), wdFormatXMLDocumentMacroEnabled
End If
End With
End Sub