Print Preview ActiveX Active Users: 105 / Visits Today: 105
Highest Active Users: 105
Print Preview ActiveX
Home | Profile | Register | Active Topics | Members | Search | FAQ | RSS
Save Password
Forgot your Password?

 All Forums
 Print Preview
 Help file
 AddStyle - Method
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic: AddTextAt - Method Topic Next Topic: AddPageTemplate - Method  


327 Posts

Posted - 07/14/2005 :  13:18:40  Show Profile
Method AddStyle


This method adds a new style to the list of styles.


AddStyle ( strStyleName As String, strFontName As String, sFontSize As Single,bFontBold As Boolean, bFontUnderline As Boolean, bFontItalic As Boolean, oleForeColor As OLE_COLOR, oleBackColor As OLE_COLOR )
Parameter         Opt/Req   Description                       
  • strStyleName Required Name assigned to style
  • strFontName Optional Name of font
  • sFontSize Optional Size of font in points, decimal point allowed
  • bFontBold Optional Bold if True. Default = False
  • bFontUnderline Optional Underline if True. Default = False
  • bFontItalic Optional Italic if True. Default = False
  • bForeColor Optional Default = vbBlack. Dec, Hex, OLE
  • bBackColor Optional Default = vbWhite. Dec, Hex, OLE

    A style is a collection of 8 values that defines the way a piece of text is displayed. The method ApplyStyle is called when a specific style is required to be used for a particular piece of text.

    A added style can be called with GetStyle. After executing the GetStyle you will receive 18 values which all can be altered with ModifyStyle.

    There are several pre-defined styles.


    To define a style:

    Preview.AddStyle  "Remark red", "Courier New", 12, True, False, True, vbBlue, vbRed
    will create this getStyle-string after :

    preview.Getstyle ("Remark red")
    Style: Remark red; Font: Courier New: Size: 12.0; Bold: True; Underline: False; Italic: True; Fore: 16711680; Back: 255; Strikethru: False; Leading: Increment; Val: 0,0; Rotation: 0,0; FillStyle: 1; FillColor: 16777215; PageSize: 9; LineWidth: 20; LineType: 0; Line Color: 0

    To define a style with some items with the default values, in this case Size, Underline, Italic :

    Preview.AddStyle "Remark red", "Courier New", , True, , , vbBlue, vbRed
    or to get a standard (with all defaults) style :

    Preview.AddStyle "Standard"
    See Also:

    ApplyStyle ----->
    GetStyle -------->
    GetAllStyles -->
    ModifyStyle --->

    Come and visit :

    Edited by - emiel on 07/27/2005 12:33:40
    Go to Bottom of Page
      Previous Topic: AddTextAt - Method Topic Next Topic: AddPageTemplate - Method  
     New Topic  Topic Locked
     Printer Friendly
    Jump To:
    Print Preview ActiveX © Mandix Go To Top Of Page
    This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000 Version 3.4.02