Message.Type Property |
Returns the category of the error. Read-only.
Message.Type
Version |
BarTender 7.50 or higher |
Edition |
Automation, Enterprise |
Message.Type returns one of the following BtMsgType constants:
btMsgTypeMiscellaneous: The message concerns something that does not fit in any of the other categories; has a value of 0.
btMsgTypeVBScripting: The message concerns a VBscript associated with the document; has a value of 1.
btMsgTypePrinter: The message concerns the printer; has a value of 2.
btMsgTypeDatabase: The message concerns database access; has a value of 3.
btMsgTypeFile: The message concerns a file; has a value of 4.
btMsgTypeCommandLine: The message concerns the BarTender command line; has a value of 5.
btMsgTypeNetworkTrace: The message concerns the network connections of the computer running BarTender; has a value of 6.
btMsgTypeLicensing: The message concerns the BarTender or printer license; has a value of 7.
btMsgTypeEmail: The message concerns the BarTender email messaging system; has a value of 8.
btMsgTypeService: The message concerns running BarTender as a service; has a value of 9.
btMsgTypeVerification: The message concerns some aspect of the template design during an attempt to export a printer code template; has a value of 10.
btMsgTypeAutomation: The message concerns BarTender automation; has a value of 11.
btMsgTypeXMLScript: The message concerns BTXML script; has a value of 12.
'Declare a BarTender application variable
Dim btApp As BarTender.Application
'Declare a BarTender document variable
Dim btFormat As BarTender.Format
'Declare a BarTender printer code template variable
Dim btPCT As BarTender.PrinterCodeTemplate
'Declare a BarTender messages variable to hold all messages
Dim btMessages As BarTender.Messages = Nothing
'Declare a variable to hold message text
Dim btMessageText As String = ""
'Declare a loop counter
Dim i As Integer
'Create a new instance of BarTender
btApp = New BarTender.Application
'Set the BarTender application visible
btApp.Visible = True
'Open a BarTender document
btFormat = btApp.Formats.Open("c:\Format1.btw", False, "")
'Set the printer code template variable
btPCT = btFormat.PrinterCodeTemplate
'Export the printer code template
btPCT.Export("SAPscript-ITF", BarTender.BtPctExportType.btPctExportSeparate, "c:\Printer Code Templates\FormatTemplate.prn", "c:\Printer Code Templates\DataTemplate.prn", btMessages)
'Ignore database messages; display the other messages
For i = 1 To btMessages.Count
If btMessages.GetMessage(i).Type = 3 Then
'Do nothing
Else
btMessageText = btMessageText & vbCrLf & btMessages.Item(i).Severity & " " & btMessages.Item(i).Message
End If
Next i
MessageBox.Show("Export failed. Errors and Warnings: " & btMessageText)
'End the BarTender process
btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges)
// Declare a BarTender application variable
BarTender.Application btApp;
// Declare a BarTender document variable
BarTender.Format btFormat;
// Declare a BarTender printer code template variable
BarTender.PrinterCodeTemplate btPCT;
// Declare a BarTender messages variable to hold all messages
BarTender.Messages btMessages;
// Declare a string variable to hold message text
string btMessageText = "";
// Declare an object variable
System.Object obj = null;
// Create a new instance of BarTender
btApp = new BarTender.Application();
// Set the BarTender application visible
btApp.Visible = true;
// Open a BarTender document
btFormat = btApp.Formats.Open("c:\\Format1.btw", false, "");
// Set the printer code template variable
btPCT = btFormat.PrinterCodeTemplate;
// Export the printer code template
btPCT.Export("SAPscript-ITF", BarTender.BtPctExportType.btPctExportSeparate, "c:\\Printer Code Templates\\FormatTemplate.prn", "c:\\Printer Code Templates\\DataTemplate.prn", ref obj);
// Set the messages variable to the object
btMessages = obj as BarTender.Messages;
// Ignore database messages; display the other messages
for (int i = 1; i <= btMessages.Count; i++)
{
if (btMessages.GetMessage(i).Type == BarTender.BtMsgType.btMsgTypeDatabase)
{
// Do nothing
}
else
{
btMessageText = btMessageText + "\n\r" + btMessages.GetMessage(i).Severity + " " + btMessages.GetMessage(i).Message;
}
}
MessageBox.Show("Export failed. Errors and Warnings: " + btMessageText);
// End the BarTender process
btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);