Get Started
Documentation

Global type definitions

 

BlipFillType

The type of a fill which uses an image as a background.

  • "tile" - if the image is smaller than the shaped which is filled, the image will be tiled all over the created shape surface.
  • "stretch" - if the image is smaller than the shape which is filled, the image will be stretched to fit the created shape surface.
Type:
  • "tile" | "stretch"
Example
// Create a blip fill with an image which is tiled all over the created shape:
oFill = Api.CreateBlipFill("http://mywebsite.com/myimage.png", "tile");
 

BordersIndex

Specifies the cell border position.

Type:
  • "DiagonalDown" | "DiagonalUp" | "Bottom" | "Left" | "Right" | "Top" | "InsideHorizontal" | "InsideVertical"
Example
// The cell will have a bottom black dotted border:
oWorksheet.GetRange("E2").SetBorders("Bottom", "Dotted", Api.CreateColorFromRGB(0, 0, 0));
 

BorderType

A border type which will be added to the document element.

  • "none" - no border will be added to the created element or the selected element side.
  • "single" - a single border will be added to the created element or the selected element side.
Type:
  • "none" | "single"
Example
// The paragraph will have a single 3 point wide green bottom border with a zero offset from the bottom paragraph edge:
oParaPr.SetBottomBorder("single", 24, 0, 0, 255, 0);
 

BulletType

A bullet type which will be added to the paragraph in spreadsheet or presentation.

Type:
  • "ArabicPeriod" | "ArabicParenR" | "RomanUcPeriod" | "RomanLcPeriod" | "AlphaLcParenR" | "AlphaLcPeriod" | "AlphaUcParenR" | "AlphaUcPeriod" | "None"
Example
// The paragraph will be starting with the Arabic numeral which has parenthesis:
oBullet = Api.CreateNumbering("ArabicParenR");
 

byte

A numeric value from 0 to 255.

Type:
  • number
Example
// The resulting color is green, the bytes are measured in decimal numbers:
oRGBColor = Api.CreateRGBColor(0, 255, 0);
// The resulting color is green, the bytes are measured in hexadecimal numbers:
oRGBColor = Api.CreateRGBColor(0, 0xff, 0);
 

ChartType

This type specifies the available chart types which can be used to create a new chart.

Type:
  • "area" | "areaStacked" | "areaStackedPercent" | "bar" | "bar3D" | "barStacked" | "barStacked3D" | "barStackedPercent" | "barStackedPercent3D" | "barStackedPercent3DPerspective" | "doughnut" | "horizontalBar" | "horizontalBar3D" | "horizontalBarStacked" | "horizontalBarStacked3D" | "horizontalBarStackedPercent" | "horizontalBarStackedPercent3D" | "line3D" | "lineNormal" | "lineStacked" | "lineStackedPercent" | "pie" | "pie3D" | "scatter" | "stock"
Examples

ChartType used in text documents

// The resulting chart will have a 'bar3D' type:
oDrawing = Api.CreateChart("bar3D", [[200, 240, 280],[250, 260, 280]], ["Projected Revenue", "Estimated Costs"], [2014, 2015, 2016], 4051300, 2347595, 24);

ChartType used in spreadsheets

// The resulting chart will have a 'bar' type:
oWorksheet.AddChart("'sheet 1'!$A$1:$D$5", true, "bar", 2, 2, 10, 7, 20);
 

DocumentElement

Any valid element which can be added to the document structure.

Example
// Add a document element called 'paragraph' to the document:
oDocument.AddElement(oParagraph);
 

EMU

English measure unit. 1 mm = 36000 EMUs, 1 inch = 914400 EMUs

Type:
  • number
Example
// Set the size of the drawing to be created as 100 mm (10 cm) in width and 100 mm (10 cm) in height:
oDrawing.SetSize(100 * 36000, 100 * 36000);
 

HdrFtrType

Header and footer types which can be applied to the document sections.

  • "default" - a header or footer which can be applied to any default page.
  • "title" - a header or footer which is applied to the title page.
  • "even" - a header or footer which can be applied to even pages to distinguish them from the odd ones (which will be considered default).
Type:
  • "default" | "title" | "even"
Example
// Remove the header of the 'title' type from the final document section:
var oDocContent = oFinalSection.RemoveHeader("title");
 

hps

Half-points (2 half-points = 1 point).

Type:
  • number
Example
// Set the text font size to 11 points:
oTextPr.SetFontSize(22);
 

line240

240ths of a line.

Type:
  • number
Example
// The paragraph line spacing is set to 1 line:
oParaPr.SetSpacingLine(240, "auto");
 

LineStyle

Specifies the line style used to form the cell border.

Type:
  • "None" | "Double" | "Hair" | "DashDotDot" | "DashDot" | "Dotted" | "Dashed" | "Thin" | "MediumDashDotDot" | "SlantDashDot" | "MediumDashDot" | "MediumDashed" | "Medium" | "Thick"
Example
// The cell will have a bottom black dotted border:
oWorksheet.GetRange("E2").SetBorders("Bottom", "Dotted", Api.CreateColorFromRGB(0, 0, 0));
 

ParagraphContent

The types of elements that can be added to the paragraph structure.

Example
// Add an element called 'text run' to the paragraph:
oParagraph.AddElement(oRun,0);
 

PatternType

The available preset patterns which can be used for the fill.

Type:
  • "cross" | "dashDnDiag" | "dashHorz" | "dashUpDiag" | "dashVert" | "diagBrick" | "diagCross" | "divot" | "dkDnDiag" | "dkHorz" | "dkUpDiag" | "dkVert" | "dnDiag" | "dotDmnd" | "dotGrid" | "horz" | "horzBrick" | "lgCheck" | "lgConfetti" | "lgGrid" | "ltDnDiag" | "ltHorz" | "ltUpDiag" | "ltVert" | "narHorz" | "narVert" | "openDmnd" | "pct10" | "pct20" | "pct25" | "pct30" | "pct40" | "pct5" | "pct50" | "pct60" | "pct70" | "pct75" | "pct80" | "pct90" | "plaid" | "shingle" | "smCheck" | "smConfetti" | "smGrid" | "solidDmnd" | "sphere" | "trellis" | "upDiag" | "vert" | "wave" | "wdDnDiag" | "wdUpDiag" | "weave" | "zigZag"
Example
// Create a fill with a 'dashDnDiag' pattern which has two colors - green and red:
oFill = Api.CreatePatternFill("dashDnDiag", Api.CreateRGBColor(0, 225, 0), Api.CreateRGBColor(255, 0, 0));
 

PositiveFixedAngle

A 60000th of a degree (5400000 = 90 degrees).

Type:
  • number
Example
// The resulting gradient direction angle is 90 degrees:
oFill = Api.CreateLinearGradientFill([oGs1, oGs2], 5400000);
 

PositivePercentage

The 1000th of a percent (100000 = 100%).

Type:
  • number
Example
// The resulting gradient stop position is 100%:
var oGs2 = Api.CreateGradientStop(Api.CreateRGBColor(255, 164, 101), 100000);
 

PresetColor

The available preset color names.

Type:
  • "aliceBlue" | "antiqueWhite" | "aqua" | "aquamarine" | "azure" | "beige" | "bisque" | "black" | "blanchedAlmond" | "blue" | "blueViolet" | "brown" | "burlyWood" | "cadetBlue" | "chartreuse" | "chocolate" | "coral" | "cornflowerBlue" | "cornsilk" | "crimson" | "cyan" | "darkBlue" | "darkCyan" | "darkGoldenrod" | "darkGray" | "darkGreen" | "darkGrey" | "darkKhaki" | "darkMagenta" | "darkOliveGreen" | "darkOrange" | "darkOrchid" | "darkRed" | "darkSalmon" | "darkSeaGreen" | "darkSlateBlue" | "darkSlateGray" | "darkSlateGrey" | "darkTurquoise" | "darkViolet" | "deepPink" | "deepSkyBlue" | "dimGray" | "dimGrey" | "dkBlue" | "dkCyan" | "dkGoldenrod" | "dkGray" | "dkGreen" | "dkGrey" | "dkKhaki" | "dkMagenta" | "dkOliveGreen" | "dkOrange" | "dkOrchid" | "dkRed" | "dkSalmon" | "dkSeaGreen" | "dkSlateBlue" | "dkSlateGray" | "dkSlateGrey" | "dkTurquoise" | "dkViolet" | "dodgerBlue" | "firebrick" | "floralWhite" | "forestGreen" | "fuchsia" | "gainsboro" | "ghostWhite" | "gold" | "goldenrod" | "gray" | "green" | "greenYellow" | "grey" | "honeydew" | "hotPink" | "indianRed" | "indigo" | "ivory" | "khaki" | "lavender" | "lavenderBlush" | "lawnGreen" | "lemonChiffon" | "lightBlue" | "lightCoral" | "lightCyan" | "lightGoldenrodYellow" | "lightGray" | "lightGreen" | "lightGrey" | "lightPink" | "lightSalmon" | "lightSeaGreen" | "lightSkyBlue" | "lightSlateGray" | "lightSlateGrey" | "lightSteelBlue" | "lightYellow" | "lime" | "limeGreen" | "linen" | "ltBlue" | "ltCoral" | "ltCyan" | "ltGoldenrodYellow" | "ltGray" | "ltGreen" | "ltGrey" | "ltPink" | "ltSalmon" | "ltSeaGreen" | "ltSkyBlue" | "ltSlateGray" | "ltSlateGrey" | "ltSteelBlue" | "ltYellow" | "magenta" | "maroon" | "medAquamarine" | "medBlue" | "mediumAquamarine" | "mediumBlue" | "mediumOrchid" | "mediumPurple" | "mediumSeaGreen" | "mediumSlateBlue" | "mediumSpringGreen" | "mediumTurquoise" | "mediumVioletRed" | "medOrchid" | "medPurple" | "medSeaGreen" | "medSlateBlue" | "medSpringGreen" | "medTurquoise" | "medVioletRed" | "midnightBlue" | "mintCream" | "mistyRose" | "moccasin" | "navajoWhite" | "navy" | "oldLace" | "olive" | "oliveDrab" | "orange" | "orangeRed" | "orchid" | "paleGoldenrod" | "paleGreen" | "paleTurquoise" | "paleVioletRed" | "papayaWhip" | "peachPuff" | "peru" | "pink" | "plum" | "powderBlue" | "purple" | "red" | "rosyBrown" | "royalBlue" | "saddleBrown" | "salmon" | "sandyBrown" | "seaGreen" | "seaShell" | "sienna" | "silver" | "skyBlue" | "slateBlue" | "slateGray" | "slateGrey" | "snow" | "springGreen" | "steelBlue" | "tan" | "teal" | "thistle" | "tomato" | "turquoise" | "violet" | "wheat" | "white" | "whiteSmoke" | "yellow" | "yellowGreen"
Example
// Create a scheme color using the 'lightYellow' color preset:
oSchemeColor = Api.CreatePresetColor("lightYellow");
 

pt

A point.

Type:
  • number
Example
// The paragraph will have a single 3 point wide green bottom border with a 1 point offset from the bottom paragraph edge:
oParaPr.SetBottomBorder("single", 24, 1, 0, 255, 0);
 

pt_8

Eighths of a point (24 eighths of a point = 3 points).

Type:
  • number
Example
// The paragraph will have a single 6 point wide green bottom border with a zero offset from the bottom paragraph edge:
oParaPr.SetBottomBorder("single", 48, 0, 0, 255, 0);
 

RelFromH

The possible values for the base which the relative horizontal positioning of an object will be calculated from.

Type:
  • "character" | "column" | "leftMargin" | "rightMargin" | "margin" | "page"
Example
// The created drawing will be centered horizontally relative to the page width:
oDrawing.SetHorAlign("page", "center");
 

RelFromV

The possible values for the base which the relative vertical positioning of an object will be calculated from.

Type:
  • "bottomMargin" | "topMargin" | "margin" | "page" | "line" | "paragraph"
Example
// The created drawing will be centered vertically relative to the paragraph height:
oDrawing.SetHorAlign("paragraph", "center");
 

SchemeColorId

The available color scheme identifiers.

Type:
  • "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6" | "bg1" | "bg2" | "dk1" | "dk2" | "lt1" | "lt2" | "tx1" | "tx2"
Example
// Create a scheme color with the 'accent2' identifier:
oSchemeColor = Api.CreateSchemeColor("accent2");
 

ShapeType

This type specifies the preset shape geometry that will be used for a shape.

Type:
  • "accentBorderCallout1" | "accentBorderCallout2" | "accentBorderCallout3" | "accentCallout1" | "accentCallout2" | "accentCallout3" | "actionButtonBackPrevious" | "actionButtonBeginning" | "actionButtonBlank" | "actionButtonDocument" | "actionButtonEnd" | "actionButtonForwardNext" | "actionButtonHelp" | "actionButtonHome" | "actionButtonInformation" | "actionButtonMovie" | "actionButtonReturn" | "actionButtonSound" | "arc" | "bentArrow" | "bentConnector2" | "bentConnector3" | "bentConnector4" | "bentConnector5" | "bentUpArrow" | "bevel" | "blockArc" | "borderCallout1" | "borderCallout2" | "borderCallout3" | "bracePair" | "bracketPair" | "callout1" | "callout2" | "callout3" | "can" | "chartPlus" | "chartStar" | "chartX" | "chevron" | "chord" | "circularArrow" | "cloud" | "cloudCallout" | "corner" | "cornerTabs" | "cube" | "curvedConnector2" | "curvedConnector3" | "curvedConnector4" | "curvedConnector5" | "curvedDownArrow" | "curvedLeftArrow" | "curvedRightArrow" | "curvedUpArrow" | "decagon" | "diagStripe" | "diamond" | "dodecagon" | "donut" | "doubleWave" | "downArrow" | "downArrowCallout" | "ellipse" | "ellipseRibbon" | "ellipseRibbon2" | "flowChartAlternateProcess" | "flowChartCollate" | "flowChartConnector" | "flowChartDecision" | "flowChartDelay" | "flowChartDisplay" | "flowChartDocument" | "flowChartExtract" | "flowChartInputOutput" | "flowChartInternalStorage" | "flowChartMagneticDisk" | "flowChartMagneticDrum" | "flowChartMagneticTape" | "flowChartManualInput" | "flowChartManualOperation" | "flowChartMerge" | "flowChartMultidocument" | "flowChartOfflineStorage" | "flowChartOffpageConnector" | "flowChartOnlineStorage" | "flowChartOr" | "flowChartPredefinedProcess" | "flowChartPreparation" | "flowChartProcess" | "flowChartPunchedCard" | "flowChartPunchedTape" | "flowChartSort" | "flowChartSummingJunction" | "flowChartTerminator" | "foldedCorner" | "frame" | "funnel" | "gear6" | "gear9" | "halfFrame" | "heart" | "heptagon" | "hexagon" | "homePlate" | "horizontalScroll" | "irregularSeal1" | "irregularSeal2" | "leftArrow" | "leftArrowCallout" | "leftBrace" | "leftBracket" | "leftCircularArrow" | "leftRightArrow" | "leftRightArrowCallout" | "leftRightCircularArrow" | "leftRightRibbon" | "leftRightUpArrow" | "leftUpArrow" | "lightningBolt" | "line" | "lineInv" | "mathDivide" | "mathEqual" | "mathMinus" | "mathMultiply" | "mathNotEqual" | "mathPlus" | "moon" | "nonIsoscelesTrapezoid" | "noSmoking" | "notchedRightArrow" | "octagon" | "parallelogram" | "pentagon" | "pie" | "pieWedge" | "plaque" | "plaqueTabs" | "plus" | "quadArrow" | "quadArrowCallout" | "rect" | "ribbon" | "ribbon2" | "rightArrow" | "rightArrowCallout" | "rightBrace" | "rightBracket" | "round1Rect" | "round2DiagRect" | "round2SameRect" | "roundRect" | "rtTriangle" | "smileyFace" | "snip1Rect" | "snip2DiagRect" | "snip2SameRect" | "snipRoundRect" | "squareTabs" | "star10" | "star12" | "star16" | "star24" | "star32" | "star4" | "star5" | "star6" | "star7" | "star8" | "straightConnector1" | "stripedRightArrow" | "sun" | "swooshArrow" | "teardrop" | "trapezoid" | "triangle" | "upArrowCallout" | "upDownArrow" | "upDownArrow" | "upDownArrowCallout" | "uturnArrow" | "verticalScroll" | "wave" | "wedgeEllipseCallout" | "wedgeRectCallout" | "wedgeRoundRectCallout"
Example
// Create a shape using the 'diamond' preset:
oDrawing = Api.CreateShape("diamond", 100 * 36000, 100 * 36000, oFill, oStroke);
 

ShdType

A shade type which can be added to the document element.

Type:
  • "nil" | "clear"
Example
// Add a green shadow to the table:
oTablePr.SetShd("clear", 0, 255, 0, false);
 

StyleType

The style type used for the document element.

Type:
  • "paragraph" | "table" | "run" | "numbering"
Example
// Assign the default document paragraph style to the 'oNormalStyle' variable:
var oNormalStyle = oDocument.GetDefaultStyle("paragraph");
 

TabJc

Types of custom tab.

Type:
  • "clear" | "left" | "right" | "center"
Example
// Set tab positions at 50, 75 and 150 points with the text aligned center, left and right at each tab stop accordingly:
oParaPr.SetTabs([1000, 1500, 3000], ["center", "left", "right"]);
 

TableStyleOverrideType

This simple type specifies possible values for the table sections to which the current conditional formatting properties will be applied when this selected table style is used.

  • "topLeftCell" - specifies that the table formatting applies to the top left cell.
  • "topRightCell" - specifies that the table formatting applies to the top right cell.
  • "bottomLeftCell" - specifies that the table formatting applies to the bottom left cell.
  • "bottomRightCell" - specifies that the table formatting applies to the bottom right cell.
  • "firstRow" - specifies that the table formatting applies to the first row.
  • "lastRow" - specifies that the table formatting applies to the last row.
  • "firstColumn" - specifies that the table formatting applies to the first column. Any subsequent row which is in table header ApiTableRowPr.SetTableHeader will also use this conditional format.
  • "lastColumn" - specifies that the table formatting applies to the last column.
  • "bandedColumn" - specifies that the table formatting applies to odd numbered groupings of rows.
  • "bandedColumnEven" - specifies that the table formatting applies to even numbered groupings of rows.
  • "bandedRow" - specifies that the table formatting applies to odd numbered groupings of columns.
  • "bandedRowEven" - specifies that the table formatting applies to even numbered groupings of columns.
  • "wholeTable" - specifies that the conditional formatting applies to the whole table.
Type:
  • "topLeftCell" | "topRightCell" | "bottomLeftCell" | "bottomRightCell" | "firstRow" | "lastRow" | "firstColumn" | "lastColumn" | "bandedColumn" | "bandedColumnEven" | "bandedRow" | "bandedRowEven" | "wholeTable"
Example
// Apply the created style (set shadow) to the top left cell of the table:
oTableStyle.GetConditionalTableStyle("topLeftCell").GetTableCellPr().SetShd("clear", 255, 0, 0);
 

TableWidth

The possible values for the units of the width property are defined by a specific table or table cell width property.

  • "auto" - set the table or table cell width to auto width.
  • "twips" - set the table or table cell width to be measured in twentieths of a point.
  • "nul" - set the table or table cell width to be of a zero value.
  • "percent" - set the table or table cell width to be measured in percent to the parent container.
Type:
  • "auto" | "twips" | "nul" | "percent"
Example
// Set the width of the table cell equal to 100 points (2000 twips):
oTableCell.SetWidth("twips", 2000);
 

TickLabelPosition

Possible values for the position of chart tick labels (either horizontal or vertical).

  • "none" - not display the selected tick labels.
  • "nextTo" - set the position of the selected tick labels next to the main label.
  • "low" - set the position of the selected tick labels in the part of the chart with lower values.
  • "high" - set the position of the selected tick labels in the part of the chart with higher values.
Type:
  • "none" | "nextTo" | "low" | "high"
Example
// Set the position of the vertical tick labels next to the main vertical label:
oChart.SetVertAxisTickLabelPosition("nextTo");
 

twips

Twentieths of a point (equivalent to 1/1440th of an inch).

Type:
  • number
Example
// Set the distance between columns equal to 36 points:
oParagraph.SetEqualColumns(2, 720);
 

VerticalTextAlign

The available text vertical alignment (used to align text in a shape with a placement for text inside it).

Type:
  • "top" | "center" | "bottom"
Example
// The inner text for the created shape will be added aligned vertically closer to the shape upper part:
oDrawing.SetVerticalTextAlign("top");