propertySettingReason Method

Microsoft FrontPage Visual Basic

Show All Show All

propertySettingReason Method

Returns an Integer that specifies the numeric value of the reason for the property setting. See property setting reasons for more information on the numeric values.

The property setting reasons and their numeric values are as follows:

Value Reason Description
0 ssrNoReason Specifies that there is no reason for the style property.
1 ssrInConflict Specifies that the style property conflicts with another style property in the same range. For example, if you have <p><span style=”font-size: small”>foo</span><font size=3>bar</font></p> and you select the entire paragraph, the properties will be in conflict.
2 ssrUninheritedDefault Specifies that the style property is a default HTML setting. For example, if an element does not have a border attribute or a border style and no border property has been set for the style attribute.
3 ssrCloneProps Specifies that a style property has been copied using the clone method.
4 ssrStoredStyles Specifies that the style property is being stored. For example, if you select a table with empty cells and apply formatting, such as BOLD, rather than putting in a B element at that point, Microsoft FrontPage stores the value until the user enters text.
5 ssrInheritFromBody Specifies that the style setting is inherited from the BODY element.
6 ssrBgPropOfSpanningParent Specifies that the style properties are inherited from surrounding SPAN elements.
7 ssrBgPropOfTableRowSection Specifies that the style properties are inherited from table row sections.
8 ssrLegendTextAlign Specifies that the style properties are for text alignment in a LEGEND element.
9 ssrBodyColorInTable Specifies that the body color is inherited peculiarly in a table.
10 ssrHeaderNestedInSupOrSub Specifies that a header inside a SUP or SUB element has a special font size.
11 ssrHTMLSemanticStructuralTagDefault Specifies that the style property is for a semantic structural element. For example, an H1 element is a semantic structural element. In addition to forcing a text paragraph, it carries the semantic meaning of a “header”. Different semantic structural tags have different default text properties.
12 ssrHTMLSemanticSpanningTagDefault Specifies that the style property is for a semantic spanning element. For example, the EM element is a semantic spanning element;in addition to applying italics (a text property), it is supposed to specify that a region of text has emphasis.
13 ssrHTMLSpanningFormattingTag Specifies that the style property is for a formatting element, such as the FONT, B, or I element.
14 ssrHTMLFontTag Specifies that the style property is for a FONT element.
15 ssrHTMLBaseFontTag Specifies that the style property is for a BASEFONT element.
16 ssrCSSStyleSheetRule Specifies that the style property is set by using a cascading style sheet rule.
17 ssrCSSStyleSheetRuleBangImportant Specifies that the style property is set by using a cascading style sheet rule with the !IMPORTANT modifier.
18 ssrCSSStyleAttribute Specifies that the style property is set by using a cascading style sheet attribute.
19 ssrCSSStyleAttributeBangImportant Specifies that the style property is set by using a cascading style sheet attribute with the !IMPORTANT modifier.
20 ssrHTMLAttr Specifies that the style property is set by using an HTML attribute.
21 ssrHTMLBorderAttr Specifies that the style property is set by using the border attribute.
22 ssrHTMLAlignAttr Specifies that the style property is set by using the align attribute.
23 ssrHTMLHSpaceAttr Specifies that the style property is set by using the hspace attribute.
24 ssrHTMLVSpaceAttr Specifies that the style property is set by using the vspace attribute.
25 ssrBODYAttr Specifies that the style property is set by using an attribute in the BODY element.
26 ssrDTC Specifies that the style property is set by using a design-time control.
27 ssrInternalVisibilityControl Specifies a style property for which FrontPage is controlling the visibility for internal purposes.
28 ssrTheme Specifies that the style property is set by using a FrontPage 98 style theme.

Note  Newer FrontPage themes are CSS-based.

29 ssrFunkyBotBusiness Specifies that the style property is set by using a FrontPage component.
30 ssrListImageIndent Specifies that the style property is for an image that is being used as a bullet in a list.
31 ssrCellHTMLPropInheritance Specifies that the style property for a table cell is inherited from the parent table.
32 ssrCellFloating
33 ssrCellPaddingFromTable Specifies that the padding property for a table cell is inherited from the parent table.
34 ssrCellBorderFromTable Specifies that the border property for a table cell is inherited from the parent table.
35 ssrFloatImpliesAlign Specifies that the alignment property is being affected by the float property.
36 ssrDoubleBorderMustBe3High Specifies that the border property is a certain thickness because the border style is set to double.
37 ssrPositionedCantFloat Specifies that the float property setting is required because the position property is set to something other than static or auto.
38 ssrStaticObjectsNoZOrder Specifies that the z order property is required because the positioned property is set to static or auto.
39 ssrListItemHeight Specifies that the style property is for the height of a list item.
40 ssrEscherChild Specifies that the style property is for an object contained inside an Escher shape.
41 ssrVerticalAlignSetsTextVAlign Specifies that the style property is for the vertical alignment of an element or object.
42 ssrHRMarginIsPadding Specifies that the style property is for an HR element for which the margin is being used as padding.
43 ssrIME Specifies that the Input Method Editor is shown in FrontPage by manipulating formatting properties on the text associated with a SPAN element.
44 ssrSetLangForINPUTTag Specifies that the style property is for an INPUT element with a lang attribute setting that comes from the locale identifier (LCID) for the user's computer. This affects the font in which page content is displayed.
45 ssrFloatMarginIsNonZero Specifies that the style property for floating text always has a margin of 3.
46 ssrBodyMarginNotLessThanZero Specifies that the style property is for the margin attribute of a BODY element that cannot cannot be set to less than zero.
47 ssrSupOrSubFormattingTag Specifies that the style property is for the formatting of a SUP or SUB element.
48 ssrHTMLCentering Specifies that the paragraph alignment is set by using a CENTER element.
49 ssrTextAlignSetsStructAlign Specifies that the structural alignment for the style property is based on the inherited text alignment.
50 ssrPositionResetsBGProps Specifies that the background properties have been reset because the specified object or element is manually positioned.
51 ssrComputedMargin Specifies that FrontPage calculates the top and bottom margin properties when the page layout is complete.

expression.propertySettingReason(strPropertyName)

expression    Required. An expression that returns one of the objects in the Applies To list.

strPropertyName    Required. A String that represents a style attribute. You can get a list of style attributes from the CSS Reference on the Microsoft Developer Network (MSDN) Web site.

Remarks

Use the propertySettingReason method if if you need to implement a formatting command that requires various style properties or where you need to know the current style properties for a range of elements. For example, if you have a text range that contains <p><span style=”font-size: small”>foo</span><font size=3>bar</font></p> and you want to set the font-size style attribute, you may want to check to see if the propertySettingReason method returns a value of 1 (ssrInConflict), which would indicate that there are conflicting property settings within the range. In that case, you may not want to apply yet another font size style setting to the range.

Example

The following example inserts text into the active document, and then if the background-color attribute isn't specified, it applies a background color to the body of the document.

    Dim objStyleState As IFPStyleState
Dim objRange As IHTMLTxtRange

Set objRange = ActiveDocument.Selection.createRange
Set objStyleState = ActiveDocument.createStyleState

With objStyleState
    If .propertySettingReason("background-color") = 0 Then
        .gather objRange
        .setProperty "background-color", vbBlue
        .Apply
    End If
End With