Open method as it applies to the WebFile object.
Opens a WebFile object.
expression.Open
expression Required. An expression that returns one of the above objects.
Open method as it applies to the Webs object.
Returns a WebEx object.
expression.Open(szWebUrl, UserName, Password, WebOpenFlags)
expression Required. An expression that returns one of the above objects.
szWebUrl Required String. The base URL of the web, such as "C:\My Webs". This can be any absolute URL, such as "http://web server" or "file://file system" for disk-based webs.
UserName Optional String. The logon name of the user.
Password Optional String. A designated string of characters to validate access to the specified web.
WebOpenFlags Optional FpWebOpenFlags.
FpWebOpenFlags can be one of these FpWebOpenFlags constants. |
fpOpenInWindow default |
fpOpenNoWindow |
This example opens the Rogue Cellars web and the Oktoberfest Sale file, and performs the following tasks:
mySaleProp
for the text parameter in the insertAdjacentText methodNote To run this example, you must have a web called "C:\My Documents\My Webs\Rogue Cellars" (for a server running on Microsoft Windows) or "C:\WINNT\Profiles\logon alias\Personal\My Webs\Rogue Cellars" (for a server running on Windows NT), or you may substitute an alternative web URL and file.
Private Sub AddSaleText()
Dim objWeb As Web
Dim objFile As WebFile
Dim strSaleProp As String
Dim strSaleText As String
strSaleText = "Vintage Wines for Oktoberfest Sale!!!"
Set objWeb = Webs.Open("C:\My Documents\My Webs\Rogue Cellars")
Set objFile = ActiveWeb.RootFolder.Files("Sale.htm")
objFile.Properties.Add "SaleText", mySaleText
strSaleProp = objFile.Properties("SaleText")
objFile.Open
ActiveDocument.body.insertAdjacentText "BeforeEnd", strSaleProp
WebWindows.Close
End Sub