Düzenle

Aracılığıyla paylaş


Document.ParseLine method (Visio)

Parses a line of Microsoft Visual Basic code.

Syntax

expression.ParseLine (Line)

expression A variable that represents a Document object.

Parameters

Name Required/Optional Data type Description
Line Required String A string interpreted as Visual Basic code.

Return value

Nothing

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

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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.