Image Viewer CP ActiveX Control

DocxAddChar

 

Prepare create Microsoft Word (.docx) file and add character to specific page. You may add character to specific row and column and set font type, font size, background, text color.

Public Function DocxAddChar( _
   ByVal iPageno As Integer, _
   ByVal strChar As String, _
   ByVal iCol As Integer, _
   ByVal iRow As Integer, _
   ByVal strFontName As String, _
   ByVal iFontSize As Integer, _
   ByVal iBgColorR As Integer, _
   ByVal iBgColorG As Integer, _
   ByVal iBgColorB As Integer, _
   ByVal iFgColorR As Integer, _
   ByVal iFgColorG As Integer, _
   ByVal iFgColorB As Integer, _
   ByVal bBold As Bool, _
   ByVal bItalic As Bool, _
   ByVal bUnderline As Bool
) As Bool

 

Parameter

iPageNo
   the page No. The first page is zero.

strChar
 add the single character.

iCol
 Specifies the x-coordinate of the character.

iRow
 Specifies the y-coordinate of the character.

strFontName
 the font name of character.

iFontSize
 the font size of character.

iBgColorR
 the color value with red component of background color of character (0-255).

iBgColorG
 the color value with green component of background color of character (0-255).

iBgColorB
 the color value with blue component of background color of character (0-255).

iFgColorR
 the color value with red component of foreground color of character (0-255).

iFgColorG
 the color value with green component of foreground color of character (0-255).

iFgColorB
 the color value with blue component of foreground color of character (0-255).

bBold
 bold the character, true - bold, false - normal.

bItalic
 italic the character, true - italic, false - normal.

bUnderline
 underline the character, true - underline, false - normal.
 

Return Value

Return true - successful
Return false - Failed


Example

   

Visual Basic Syntax
ImageViewer1.DocxAddChar 0, "T", 0, 0, "Arial", 10, 255, 255, 255, 255, 0, 0, False, False, False
ImageViewer1.DocxAddChar 0, "h", 1, 0, "Arial", 10, 255, 255, 255, 255, 0, 0, False, False, False
ImageViewer1.DocxAddChar 0, "i", 2, 0, "Arial", 10, 255, 255, 255, 255, 0, 0, False, False, False
ImageViewer1.DocxAddChar 0, "s", 3, 0, "Arial", 10, 255, 255, 255, 255, 0, 0, False, False, False
ImageViewer1.DocxAddChar 0, " ", 4, 0, "Arial", 10, 255, 255, 255, 255, 0, 0, False, False, False
ImageViewer1.DocxAddChar 0, "i", 5, 0, "Arial", 10, 255, 255, 255, 255, 0, 0, False, False, False
ImageViewer1.DocxAddChar 0, "s", 6, 0, "Arial", 10, 255, 255, 255, 255, 0, 0, False, False, False
ImageViewer1.DocxAddChar 0, " ", 7, 0, "Arial", 10, 255, 255, 255, 255, 0, 0, False, False, False
ImageViewer1.DocxAddChar 0, "t", 8, 0, "Arial", 10, 255, 255, 255, 255, 0, 0, False, False, False
ImageViewer1.DocxAddChar 0, "e", 9, 0, "Arial", 10, 255, 255, 255, 255, 0, 0, False, False, False
ImageViewer1.DocxAddChar 0, "x", 10, 0, "Arial", 10, 255, 255, 255, 255, 0, 0, False, False, False
ImageViewer1.DocxAddChar 0, "t", 11, 0, "Arial", 10, 255, 255, 255, 255, 0, 0, False, False, False
ImageViewer1.DocxAddChar 0, "1", 12, 0, "Arial", 10, 255, 255, 255, 255, 0, 0, False, False, False

If ImageViewer1.DocxCreateFile("c:\test1.docx") Then
    MsgBox "save c:\test1.docx completed"
End If