So I have a database where students record their examination notes.
At the end of their examination I expect them to add important photos to a Word document template called "Continuity Imaging Record" that I have pre-made. The Word document successfully pulls information from the Access database such as Examiner details, Examination date, Case number ect ect using bookmarks. That's not the issue.
The issue is..... I want the code (below) to ask the student where do they want to save the file, instead of automatically saving there file in the same directory as the template file. Is there a piece of code that I can add below which will prompt the Save as dialog box for the student so they can navigate to their case folder and save it there?
Any help will be appreciated it. Thank you
Code:
Private Sub cmdPrint_Click()
Dim appWord As Word.Application
Dim DOC As Word.Document
'Avoid error 429, when Word isn’t open.
On Error Resume Next
Err.Clear
'Set appWord object variable to running instance of Word.
Set appWord = GetObject(, "Word.Application")
If Err.Number <> 0 Then
'If Word isn’t open, create a new instance of Word.
Set appWord = New Word.Application
End If
Set DOC = appWord.Documents.Open("H:\Abilas 1.16.8\Continuity Imaging Record.docx", , True)
With DOC
.FormFields("flddateexam").Result = Me![Dateofexamination]
.FormFields("fldexaminer").Result = Me![examiner]
.FormFields("fldcasenum").Result = Me![Casenumber]
.Visible = True
.Activate
.SaveAs2 Me![Filenamecont] &".docx"
End
Set DOC = Nothing
Set appWord = Nothing
Exit Sub
errHandler:
MsgBox Err.Number & ": " & Err.Description
End With
End Sub