& “order shipped on “ _
& Format(Date, “dd-mmm-yyyy”)
MsgBox strPrompt, vbInformation, strTitleErrorHandlerExit:Figure 12.6 shows the “Finished!” message after all the sets of labels have been created.FIGURE 12.6The success message after all labels have been printed.
Clear the progress meter:Application.SysCmd acSysCmdClearStatusExit SubErrorHandler:
If Err = 429 ThenWord is not running; open Word with CreateObject:Set appWord = CreateObject(“Word.Application”)
Resume Next
Else
MsgBox “Error No: “ & Err.Number & “; Description: “ _
& Err.Description
Resume ErrorHandlerExit
End IfEnd SubThe GetDocumentsPathfunction that retrieves the Documents path from tblInfo is listed next;
the GetTemplatesPathfunction is similar:Public Function GetDocumentsPath() As StringOn Error GoTo ErrorHandlerSet dbs = CurrentDb
Set rst = dbs.OpenRecordset(“tblInfo”)Going Beyond the Basics 12