ParseLine Method [Visio 2003 SDK Documentation]
Parses a line of Microsoft Visual Basic code.
object**.ParseLine** (Line)
object Required. An expression that returns a Document object.
Line Required String. A string interpreted as Visual Basic code.
Version added
4.5
Remarks
The ParseLine method tells the Microsoft Visual Basic for Applications (VBA) project of the Document object to parse the string passed to it as an argument.
The ParseLine method raises an exception if the string fails to parse.
Example
You can use the following procedure to determine whether a string has been successfully parsed. If the parse succeeds, the procedure displays a message box that announces the success; if the parse fails, it displays a message box that announces the failure.
Public Sub ParseLine_Example()
Call LineParser("String to parse.")
End Sub
Public Sub LineParser(strString As String)
On Error Resume Next
ThisDocument.ParseLine strString
If Err = 0 Then
MsgBox "String parsed successfully"
Else
MsgBox "Parse not successful"
End If
End Sub
Applies to | Document object
See Also | ExecuteLine method