IFPStyleState Object
Multiple objects IFPStyleState IFPStyleLength |
Contains information about the styles associated with a given element or text range on the current page. The IFPStyleState object allows you to view and edit any style property associated with a given element. Once style properties are modified, Microsoft FrontPage uses the new style information to render the new text based on the original styles.
Using the IFPStyleState object
Use the CreateStyleState property of the FPHTMLDocument object to create an IFPStyleState object. The following example creates a new IFPStyleState object and stores it in a variable called objSs.
Sub NewStyleState()
'Creates a new style state object
Dim objSs As IFPStyleState
Set objSs = Application.ActiveDocument.createStyleState
End Sub
Use the gather method to associate a style state with a specified element or range. The following example creates an IFPStyleState object, associates it with a text range on the active document, and modifies its properties. The resulting text is rendered with the new styles.
Sub ChangeStyleState()
'Changes the style state of a given text range
Dim objSs As IFPStyleState
Dim objRng As IHTMLTxtRange
Application.ActiveDocument.body.innerHTML = "Hello Style State World"
Set objRng = Application.ActiveDocument.body.createTextRange
Set objSs = Application.ActiveDocument.createStyleState
objSs.gather objRng
objSs.fontWeight = 700
objSs.fontFamily = "arial"
objSs.Apply
End Sub
Use the apply method to apply any changes made to the text range or element.
Properties | backgroundAttachment Property | backgroundColor Property | backgroundImage Property | backgroundPositionX Property | backgroundPositionY Property | backgroundRepeat Property | bididir Property | borderBottomColor Property | borderBottomStyle Property | borderBottomWidth Property | borderCollapse Property | borderLeftColor Property | borderLeftStyle Property | borderLeftWidth Property | borderRightColor Property | borderRightStyle Property | borderRightWidth Property | borderTopColor Property | borderTopStyle Property | borderTopWidth Property | bottom Property | clearLeft Property | clearRight Property | clipBottom Property | clipLeft Property | clipRight Property | clipTop Property | color Property | cursor Property | display Property | floatVal Property | fontFamily Property | fontSize Property | fontStyle Property | fontVariant Property | fontWeight Property | height Property | left Property | letterSpacing Property | lineHeight Property | listStyleImage Property | listStylePosition Property | listStyleType Property | marginBottom Property | marginLeft Property | marginRight Property | marginTop Property | ncssBdo Property | ncssBookmark Property | ncssBordercolordark Property | ncssBordercolorlight Property | ncssCite Property | ncssCode Property | ncssDfn Property | ncssDynanim Property | ncssEm Property | ncssHyperlink Property | ncssKbd Property | ncssLabelfor Property | ncssLang Property | ncssNobr Property | ncssSamp Property | ncssSpanclass Property | ncssSpandir Property | ncssStrong Property | ncssSub Property | ncssSup Property | ncssTableCellspacing Property | ncssTblAlign Property | ncssTextValign Property | ncssVar Property | ncssXime Property | overflow Property | paddingBottom Property | paddingLeft Property | paddingRight Property | paddingTop Property | position Property | propertyCount Property | Right Property | textAlign Property | textDecorationBlink Property | textDecorationLineThrough Property | textDecorationOverline Property | textDecorationUnderline Property | textIndent Property | textTransform Property | top Property | verticalAlign Property | visibility Property | whiteSpace Property | width Property | wordSpacing Property | zIndex Property
Methods | apply Method | applyToElement Method | applyToRange Method | clearAllFormatting Method | clearTextFormatting Method | clone Method | createStyleLength Method | gather Method | gatherFromElement Method | getProperty Method | propertyInConflict Method | propertySettingReason Method | setProperty Method | setToDefault Method
Parent Objects | DispFPHTMLDocument Object | FPHTMLDocument Object | IFPDocument Object
Child Objects | IFPStyleLength Object