brucerwalker
Registered User.
- Local time
- Today, 03:50
- Joined
- Sep 23, 2015
- Messages
- 24
I have a database that will export a report in .pdf format. I would like to change it so its output is in word format. I think the code that controls it is below. What would need to be changed in order to export the report in Microsoft Word? Thanks!
Private Sub Command56_Click()
Dim dlgSaveAs As FileDialog
Dim strPath As String
Set dlgSaveAs = Application.FileDialog(msoFileDialogSaveAs)
With dlgSaveAs
.InitialFileName = CurrentProject.Path & "\*.pdf"
.Title = "Save As"
End With
If dlgSaveAs.Show = True Then
strPath = dlgSaveAs.SelectedItems(1)
'MsgBox strPath
DoCmd.OutputTo acOutputReport, "Report2", acFormatPDF, strPath
Else
MsgBox "Save was cancelled"
End If
End Sub
Private Sub Command56_Click()
Dim dlgSaveAs As FileDialog
Dim strPath As String
Set dlgSaveAs = Application.FileDialog(msoFileDialogSaveAs)
With dlgSaveAs
.InitialFileName = CurrentProject.Path & "\*.pdf"
.Title = "Save As"
End With
If dlgSaveAs.Show = True Then
strPath = dlgSaveAs.SelectedItems(1)
'MsgBox strPath
DoCmd.OutputTo acOutputReport, "Report2", acFormatPDF, strPath
Else
MsgBox "Save was cancelled"
End If
End Sub