<< Click to Display Table of Contents >> Shading (object) |
Access paths for paragraph shading:
▪Application à Documents à Item à Paragraphs à Item à Shading
▪Application à ActiveDocument à Paragraphs à Item à Shading
Access paths for table shading:
▪Application à Documents à Item à Tables à Item à Shading
▪Application à ActiveDocument à Tables à Item à Shading
Access paths for table row shading:
▪Application à Documents à Item à Tables à Item à Rows à Item à Shading
▪Application à ActiveDocument à Tables à Item à Rows à Item à Shading
Access paths for table cell shading:
▪Application à Documents à Item à Tables à Item à Cell(x, y) à Shading
▪Application à ActiveDocument à Tables à Item à Cell(x, y) à Shading
▪Application à Documents à Item à Tables à Item à Rows à Item à Cells à Item à Shading
▪Application à ActiveDocument à Tables à Item à Rows à Item à Cells à Item à Shading
1 Description
The Shading object represents the shading of paragraphs, tables, table rows and cells. It is a child object of Paragraph, Table, Row or Cell.
2 Access to the object
Each paragraph, table, table tow or cell has exactly one instance of the Shading object. It is accessed through the object pointer Shading in the respective object:
' Change the shading of the first paragraph
tm.ActiveDocument.Paragraphs(1).Shading.Texture = smoPatternHalftone
' Change the shading of the first table
tm.ActiveDocument.Tables(1).Shading.Texture = smoPatternHalftone
' Change the shading of the second row in the first table
tm.ActiveDocument.Tables(1).Rows(2).Shading.Texture = smoPatternHalftone
' Change the shading of the third cell in the second row from the first table
tm.ActiveDocument.Tables(1).Rows(2).Cells(3).Shading.Texture = smoPatternHalftone
3 Properties, objects, collections and methods
Properties:
▪Texture
▪Intensity
▪ForegroundPatternColor
▪ForegroundPatternColorIndex
▪BackgroundPatternColor
▪BackgroundPatternColorIndex
Objects:
▪Application → Application
▪Parent → Paragraph, Table, Row or Cell
Texture (property)
Data type: Long (SmoShadePatterns)
Gets or sets the fill pattern for the shading. The possible values are:
smoPatternNone = 0
smoPatternHalftone = 1
smoPatternRightDiagCoarse = 2
smoPatternLeftDiagCoarse = 3
smoPatternHashDiagCoarse = 4
smoPatternVertCoarse = 5
smoPatternHorzCoarse = 6
smoPatternHashCoarse = 7
smoPatternRightDiagFine = 8
smoPatternLeftDiagFine = 9
smoPatternHashDiagFine = 10
smoPatternVertFine = 11
smoPatternHorzFine = 12
smoPatternHashFine = 13
To add a shading, set the Texture property to smoPatternHalftone and specify the required intensity of shading with the Intensity property.
To add a pattern, set the Texture property to one of the values from smoPatternRightDiagCoarse to smoPatternHashFine.
To remove an existing shading or pattern, set the Texture property to smoPatternNone.
Intensity (property)
Data type: Long
Gets or sets the intensity of the shading. The possible values are between 0 and 100 (percent).
This value can be set or get only if a shading was chosen with the Texture property (i.e., the Texture property was set to smoPatternHalftone). If a pattern was chosen (i.e., the Texture property has any other value), accessing the Intensity property fails.
ForegroundPatternColor (property)
Data type: Long (SmoColor)
Gets or sets the foreground color for the shading or pattern as a "BGR" value (Blue-Green-Red triplet). You can either provide an arbitrary value or use one of the pre-defined BGR color constants.
ForegroundPatternColorIndex (property)
Data type: Long (SmoColorIndex)
Gets or sets the foreground color for the shading or pattern as an index color. "Index colors" are the 16 standard colors of TextMaker, numbered from 0 for black to 15 for light gray. You may use the values shown in the Index colors table.
Note: It is recommended to use the ForegroundPatternColor property (see above) instead of this one, since it is not limited to the 16 standard colors but enables you to access the entire BGR color palette.
BackgroundPatternColor (property)
Data type: Long (SmoColor)
Gets or sets the background color for the shading or pattern as a "BGR" value (Blue-Green-Red triplet). You can either provide an arbitrary value or use one of the pre-defined BGR color constants.
BackgroundPatternColorIndex (property)
Data type: Long (SmoColorIndex)
Gets or sets the background color for the shading or pattern as an index color. "Index colors" are the standard colors of TextMaker, numbered from 0 for black to 15 for light gray. You may use the values shown in the Index colors table.
Note: It is recommended to use the ForegroundPatternColor property (see above) instead of this one, since it is not limited to the 16 standard colors but enables you to access the entire BGR color palette.
Application (pointer to object)
Data type: Object
Returns the Application object.
Parent (pointer to object)
Data type: Object
Returns the parent object, i.e. an object of the types Paragraph, Table, Row or Cell.
Example for the usage of the Shading object
Sub Main
Dim tm as Object
Set tm = CreateObject("TextMaker.Application")
tm.Visible = True
With tm.ActiveDocument.Paragraphs.Item(1)
.Shading.Texture = smoPatternHorzFine
.Shading.BackgroundPatternColor = smoColorAqua
End With
Set tm = Nothing
End Sub