返回或设置 String 类型的值,该值代表给定 URL 的 FpURLComponent。FpURLComponent 对应于表示文件位置的 URL 中的一部分。
expression.ParseURL(Url, URLComponent)
expression 必选。返回 Application 对象的表达式。
Url 必选,String 类型。要解析的 URL。
URLComponent 必选,FpURLComponent 常数。由该方法返回的 URL 的组件。
FpURLComponent 可以是下列这些 FpURLComponent 常数之一。 |
fpURLComponentBookmark |
fpURLComponentFileExtension |
fpURLComponentFileName |
fpURLComponentPassword |
fpURLComponentPath |
fpURLComponentPort |
fpURLComponentQuery |
fpURLComponentScheme |
fpURLComponentServer |
fpURLComponentUserName |
下列示例使用 fpURLComponentFileName 参数从 URL 中提取文件名,并将其显示给用户。
Sub FrontPageParseURL()
'Parses the URL into its components
Dim objApp As FrontPage.Application
Dim strURL As String
Set objApp = FrontPage.Application
'Parse the URL and retrieve the filename component
strURL = objApp.ParseURL("file:///D:/Documents and Settings/UserName/My Documents/My Webs/Index.htm", _
fpURLComponentFileName)
'Display the message to the user.
MsgBox "The filename is " & strURL & "."
End Sub