Calling Subroutine
Accessing Shared Borders
Accessing Shared Borders
Use the SharedBorders property of the
WebEx
or
WebFile
object to access shared borders on a page or for an entire Web site. Along with the
SharedBorders property, there are five fpSharedBorder constants that you
use to
get and set top, left, right, and bottom shared borders of a Web site or page.
The objects used in this sample are:
Adding or Removing Shared Borders to or from a Web Site
The following sample adds or removes all borders (top, left, right, and bottom) to
or from all pages in the
active Web.
Note This does not include pages that have been individually formatted
with shared borders.
Sample 1
Sub AddRemoveAllSharedBorders(ByVal objWeb As WebEx, _
ByVal blnAdd As Boolean)
objWeb.SharedBorders(fpBorderAll) = blnAdd
End Sub
Sub CallAddRemoveAllSharedBorders()
Call AddRemoveAllSharedBorders(objWeb:=ActiveWeb, blnAdd:=False)
End Sub
Adding or Removing Shared Borders to or from a Web Page
You can also individually modify the shared borders for a single page. The
following sample adds or removes shared borders to or from a specified page.
Note This does not affect any pages in the Web site other than the
specified page.
Sample 2
Sub AddRemoveSharedPageBorders(ByVal objPage As WebFile, _
ByVal blnAdd As Boolean)
objPage.SharedBorders(fpBorderAll) = blnAdd
End Sub
Sub CallAddRemoveSharedPageBorders()
Call AddRemoveSharedPageBorders(objPage:=ActiveWeb.LocateFile _
(ActiveDocument.Url), blnAdd:=True)
End Sub
Verifying Shared Borders
To see what borders are added to a Web site, you can use the fpBorderAll
constant to return an Integer that indicates which borders are added to a Web
site or
page. The Integer is comprised of the total value of fpSharedBorder
constants for borders that you have applied to a specific Web site or page. For example, if the
top and left borders are applied, the Integer returned would be a three, which
would be the value of the fpBorderTop (1) and fpBorderLeft (2), or if all
borders are applied, you will get 15, which is the total value of fpBorderTop
(1), fpBorderLeft (2), fpBorderRight (4), fpBorderBottom (8).
You can also use the other fpSharedBorder constants (fpBorderTop,
fpBorderLeft, fpBorderRight, and fpBorderBottom) to return the folder and file
name of the shared border. If you did not apply the specified border, the SharedBorders
property returns an empty string.
You can also use the hasSharedBorders property of the DispFPHTMLDocument object to determine if a specific document has shared
borders. The following sample uses the hasSharedBorders property to determine if
the active document has shared borders and if it does, opens the shared border
files.
Sample 3
Sub OpenSharedBorderFiles()
Dim strFiles(1 To 4) As String
Dim intCount As Integer
Dim objPage As WebFile
If ActiveDocument.hasSharedBorders = True Then
Set objPage = ActiveWeb.LocateFile(ActiveDocument.Url)
strFiles(1) = objPage.SharedBorders(fpBorderBottom)
strFiles(2) = objPage.SharedBorders(fpBorderLeft)
strFiles(3) = objPage.SharedBorders(fpBorderRight)
strFiles(4) = objPage.SharedBorders(fpBorderTop)
For intCount = 1 To 4
If strFiles(intCount) "" Then
Set objPage = ActiveWeb.LocateFile(strFiles(intCount))
objPage.Open
End If
Next intCount
End If
End Sub