
The following example creates a rectangle shape and fills it with red (RGB value 255, 0, 0): To use the fill mode, you must the FillStyle property to the SOLID fill mode. The main property for single-color fills is: The permissible values are defined in .FillStyle. The fill mode of a drawing object is defined using the FillStyle property. The fourth variant is the option of projecting existing graphics into the fill area. The options for defining color gradients and hatches let you create other colors into play.


The simplest variant is a single-color fill. Fill properties are combined in the .FillProperties service.Īpache OpenOffice recognizes four main types of formatting for a fill area. This section describes four services and in each instance the sample program code uses a rectangle shape element that combines several types of formatting. At the end, the drawing object is assigned to a page using a Page.add call. The program code then uses the Doc.createInstance call to create the rectangle drawing object as specified by the .RectangleShape service. The lengths are specified in hundredths of a millimeter. The Point and Size structures with the point of origin (left hand corner) and the size of the drawing object are then initialized. The following example sets the page size of a drawing document which has just been opened to 20 x 20 centimeters with a page margin of 0.5 centimeters:ĭim Doc As Object Dim Page As Object Dim RectangleShape As Object Dim Point As New com. If these settings are changed, then all of the pages in the document are affected. Orientation (Enum) page orientation (in accordance with .PaperOrientation enumeration) Number (Short) number of pages (numbering begins at 1), read-only Height (Long) page height in hundredths of a millimeter Width (Long) page width in hundredths of a millimeter

The service recognizes the following properties:īorderLeft (Long) left-hand border in hundredths of a millimeterīorderRight (Long) right-hand border in hundredths of a millimeterīorderTop (Long) top border in hundredths of a millimeterīorderBottom (Long) bottom border in hundredths of a millimeter The preceding call returns a page object that supports the .DrawPage service. In the second example, the page is accessed by its name and the getByName method. In Example 1, the page is accessed by its number (counting begins at 0).
