Represents the Microsoft FrontPage application. The Application object includes properties and methods that return top-level objects. For example, the ActiveDocument property returns a document object that references the FrontPage Page object model that is compatible with Microsoft Internet Explorer 4.0 and later.
Using the Application Object
Use the Application property to return the Application object. You can use the Application property from any of the objects in FrontPage. The following example checks the current user’s logon and sets appropriate security settings from the active Web object.
Private Sub GetLogonName()
Dim myWeb As Web
Dim currLogonName As String
Dim userSecurityLevel As Integer
Set myWeb = ActiveWeb
CurrentLogonName = myWeb.Application.UserName
If CurrentLogonName = “Guest”
userSecurityLevel = 10
Else
Call CheckUserName(currLogonName)
End If
End Sub
Many of the properties and methods that return the most common user-interface objects, such as the ActiveDocument property, can be used without the Application object qualifier. For example, instead of writing Application.ActiveDocument.Title
, you can write ActiveDocument.Title
. Properties and methods that can be used without the Application object qualifier are considered "global." To view global properties and methods in the Object Browser, click <globals> at the top of the list in the Classes box of the Object Browser.
Remarks
To use Automation to control FrontPage from another application, use the CreateObject or GetObject function to return a FrontPage Application object. The following Microsoft Word Visual Basic for Applications example starts FrontPage, opens an existing web, and closes the web.
Private Sub StartFrontPage()
Dim myNewFP As Variant
Set myNewFP = CreateObject("FrontPage.Application")
myNewFP.Webs.Open ("C:\MyWebs\Adventure Works")
myNewFP.Webs.Close "(C:\MyWebs\Adventure Works")
Set myNewFP = Nothing
End Sub