Product: LABELVIEW, CODESOFT
Version: 2014 and Later, LABELVIEW Gold and CODESOFT Enterprise
|
dim invalid, textCancel
'check if image path is invalid
invalid = not ( IsValidImageFile(DocObject) )
'if image path is invalid ask user to confirm job cancel
if invalid = vbtrue then
Dim intUserResponse
intUserResponse = Msgbox("Invalid image path, Cancel job?",308,"Warning")
Select Case intUserResponse
Case 6
Msgbox("Canceled")
Cancel = vbtrue
textCancel = "canceled"
Case 7
Cancel = vbfalse
textCancel = "continued, however"
End Select
end if
'log error for invalid image, note if user canceled or not
if invalid = vbtrue then
dim strFile
dim objFSO
dim objFile
dim strText
strFile = "C:\temp\ScriptLog.txt"
set objFSO = CreateObject("Scripting.FileSystemObject")
'open log file to append, create file if it does not exist
set objFile = objFSO.OpenTextFile(strFile, 8, true)
strText = Document.FullName & " printjob " & textCancel & ", the image " & DocObject.Name & " has an invalid path with data " & DocObject.VariableObject.Value
objFile.WriteLine strText
set objFile = nothing
set objFSO = nothing
end if
The following window should pop up:
Now, when the print is sent through and the image path is invalid, the following message will appear:
|