Home > BSPrinter documentation > Reference

SetHeader Method

Applies to: PrintPreview, IPrinterEx object

  Return Type:     None.  
   In     Optional     TextOrPicture     As     Variant  
   In     Optional     Position     As     BSHorizontalPositionConstants     Default value: bsHPosLeft (0)  
   In     Optional     DistanceFromEdge     As     Single     Default value: 15  
   In     Optional     MultilineTextAlignment     As     BSMultilineTextAlignmentConstants     Default value: bsMTAlignAccordingToPosition (-1)  
   In     Optional     Font     As     Variant  
   In     Optional     TextColor     As     Long     Default value: 0  
   In     Optional     PictureScale     As     Single     Default value: 1  


Sets an image or text that will be printed as a header on each page, such as a logo or a note.
It can be an image or a text, but not both. This setting is for all the report, it cannot be set for individual pages.

Parameters explained:

TextOrPicture: this Variant parameter can accept a stdPicture with an image or a text.
To remove a header previously set, omit this parameter, or provide an empty Variant, an Object variable containing Nothing or a null String.

Position: sets the position of the image or text (single line text) to the left, right or horizontally centered.
bsHPosLeft = 0
bsHPosRight = 1
bsHPosCenter = 2
The default value is bsHPosLeft.

DistanceFromEdge: sets the distance from the edge of the page to the footer.
Note that the footer and header are usually within the margin space.
The default value is 15 millimeters (0.59 inch).

MultilineTextAlignment: sets the alignment of the different lines of text when the text does not fit in one line or has vbCrLf in it.

Font : sets the font for the text.
Default font is Arial 12 Regular.

TextColor: sets the fore color of the text.
The default color is vbBlack.

PictureScale: sets the scale of the picture.
The default scale is 1.

See Also:

SetFooter method
AddWatermark method