publish
plugins.it2be_word.IWDocument info


Servoy Properties Summary
Boolean debugMissingBookmarks
String font
String fontColor
Number fontKerning
Number fontSpacing
Number importKeepSourceFormatting
Number importUseDestionationStyles
Boolean removeEmptyParagraphsFromMailmerge
Boolean removeUnusedFieldsFromMailmerge
Boolean surpressBlankLinesFromMailmerge


Servoy Methods Summary
void appendDocument( IWDocument, Number, Boolean )
void appendDocument( IWDocument, Number )
void appendDocument( IWDocument, Boolean )
void appendDocument( IWDocument )
IWDocument clone( )
IWFormattedDataSet convertDataSet( JSDataSet )
IWChart createChart( Number, Number, Number )
IWTable createTable( Object )
IWTable createTable( Object, Array<Object> )
Array<IWBookmark> getBookmarks( )
Document getDocument( )
Number getFontSize( )
Array<String> getMailMergeFieldNames( )
void gotoBookmark( String )
void gotoEnd( )
void gotoStart( )
void insertAlignment( Number )
void insertBookmark( String, String )
void insertChart( IWChart )
void insertCheckbox( String, Boolean, Number )
void insertDocument( IWDocument )
void insertDocument( IWDocument, Number )
void insertField( String, String )
void insertHtml( String )
void insertImage( Object )
void insertImage( Object, Number, Number )
void insertImage( Object, String, String )
void insertMailMergeField( String, String, String, Number, Number, Number )
void insertPagebreak( )
void insertStyleIdentifier( Number )
void insertTable( IWTable )
void insertTableOfContents( String )
void insertText( String, String, String, Number, Number, Number )
void mailMerge( Object )
void mailMergeRegions( DataTable )
void mergeLinqTemplate( LinqDataSource, Array<String> )
void mergeLinqTemplate( LinqDataSource )
void mergeLinqTemplate( Array<LinqDataSource>, Array<String> )
void mergeLinqTemplate( Array<LinqDataSource> )
void moveToFirstFooter( Number )
void moveToFirstFooter( )
void moveToFirstHeader( )
void moveToFirstHeader( Number )
void moveToPrimaryFooter( Number )
void moveToPrimaryFooter( )
void moveToPrimaryHeader( Number )
void moveToPrimaryHeader( )
void removeBookmark( String )
void replaceBookmark( String, String )
void replaceBookmarkWithCheckbox( String, String, Boolean, Number )
void replaceBookmarkWithImage( String, Object, Number, Number )
void replaceBookmarkWithImage( String, Object )
void replaceBookmarkWithPageBreak( String )
void replaceBookmarkWithTable( String, IWTable )
void replaceBookmarks( Object )
void replaceBookmarks( Array<String>, Array<Object> )
void replaceRegEx( String, String )
void replaceText( String, String )
void replaceTextTags( Object )
void replaceTextTags( Object, String )
String save( String, Boolean )
String save( String, Number )
String save( String, Number, String )
String save( String, String )
String save( String, Number, String, Boolean )
String save( String, String, Boolean )
String save( String )
void setAuthor( String )
void setCheckboxValue( String, Boolean )
void setComments( String )
void setCompany( String )
void setDifferentFirstPageHeaderFooter( Boolean )
void setFontAttributes( String, String, Number, Number, Number )
void setFontFolder( String, Boolean )
void setFontFolders( Array<String>, Boolean )
void setKeywords( String )
void setPaperOrientationLandscape( )
void setPaperOrientationPortrait( )
void setPaperSize( Number )
void setTitle( String )
void setVersion( Number )
void updateFields( )


Servoy Properties Details


debugMissingBookmarks
Boolean  debugMissingBookmarks
Show debugging output for missing bookmarks.
Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient


font
String  font
Get/Set the textFont for the rest of the document.
Returns
String  font String

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get/Set the textFont for the rest of the document.
// Important: Sample documents are stored in a server folder but your (smart) client needs locally stored documents!

// Sample documents are stored in the application_server/docs folder
var vSamplePath = "../application_server/docs/it2be-word";
if ( application.getOSName( ).indexOf( "Mac" ) > -1 ) {
vSamplePath = "../../../" + vSamplePath;
}

// Create the Word document with the selected original
var vDocument = plugins.it2be_word.openDocument( vSamplePath + "/Bookmarks.dot" );
var vInsertion = plugins.it2be_word.openDocument( vSamplePath + "/Insertion.doc" );

//go to the selected bookmark, insert object and remove bookmark
/** @type {String} */
var text = utils.dateFormat( new Date( ), i18n.getDefaultDateFormat( ) );

vDocument.gotoBookmark( "date" );
vDocument.textFont = "Courier,2,12";
vDocument.fontColor = "#ff0000";
vDocument.insertText( text );
vDocument.removeBookmark( "date" );

vDocument.gotoBookmark( "company_name" );
vDocument.textFont = "Courier,2,12";
vDocument.insertText( "IT2BE" );
vDocument.removeBookmark( "company_name" );

vDocument.gotoBookmark( "fullname" );
vDocument.textFont = "Courier,2,12";
vDocument.insertText( "Marcel Trapman" );
vDocument.removeBookmark( "fullname" );

vDocument.gotoBookmark( "fax_direct" );
vDocument.textFont = "Courier,2,12";
vDocument.insertText( "+31 847 44 36 75" );
vDocument.removeBookmark( "fax_direct" );

vDocument.gotoBookmark( "firstname" );
vDocument.textFont = "Courier,2,12";
vDocument.insertText( "Marcel," );
vDocument.removeBookmark( "firstname" );

vDocument.gotoBookmark( "body" );
vDocument.insertDocument( vInsertion )
vDocument.insertText( "Use the replaceBookmarks(vDataSet) method to replace the bookmarks found in the sample document.

To create bookmarks you should follow the below steps:" );
vDocument.removeBookmark( "body" );

vDocument.removeBookmark( "company_logo" );

vDocument.gotoBookmark( "user" );
vDocument.insertText( "security.getUserName()" );
vDocument.removeBookmark( "user" );

// Define where and under what name you want the save the new file
// the path name should ALWAYS be the complete absolute path
// by adding the extension or the document type you also set the format (default is .docx)
// available formats/extensions are .doc, .docx, .txt and .html
var vDocumentPath = plugins.file.getDesktopFolder( ) + "/it2be-word.docx";
vDocument.save( vDocumentPath );


fontColor
String  fontColor
Get/Set the textFont color for the rest of the document.
Returns
String  color String

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get/Set the textFont for the rest of the document.
// Important: Sample documents are stored in a server folder but your (smart) client needs locally stored documents!

// Sample documents are stored in the application_server/docs folder
var vSamplePath = "../application_server/docs/it2be-word";
if ( application.getOSName( ).indexOf( "Mac" ) > -1 ) {
vSamplePath = "../../../" + vSamplePath;
}

// Create the Word document with the selected original
var vDocument = plugins.it2be_word.openDocument( vSamplePath + "/Bookmarks.dot" );
var vInsertion = plugins.it2be_word.openDocument( vSamplePath + "/Insertion.doc" );

//go to the selected bookmark, insert object and remove bookmark
/** @type {String} */
var text = utils.dateFormat( new Date( ), i18n.getDefaultDateFormat( ) );

vDocument.gotoBookmark( "date" );
vDocument.textFont = "Courier,2,12";
vDocument.fontColor = "#ff0000";
vDocument.insertText( text );
vDocument.removeBookmark( "date" );

vDocument.gotoBookmark( "company_name" );
vDocument.textFont = "Courier,2,12";
vDocument.insertText( "IT2BE" );
vDocument.removeBookmark( "company_name" );

vDocument.gotoBookmark( "fullname" );
vDocument.textFont = "Courier,2,12";
vDocument.insertText( "Marcel Trapman" );
vDocument.removeBookmark( "fullname" );

vDocument.gotoBookmark( "fax_direct" );
vDocument.textFont = "Courier,2,12";
vDocument.insertText( "+31 847 44 36 75" );
vDocument.removeBookmark( "fax_direct" );

vDocument.gotoBookmark( "firstname" );
vDocument.textFont = "Courier,2,12";
vDocument.insertText( "Marcel," );
vDocument.removeBookmark( "firstname" );

vDocument.gotoBookmark( "body" );
vDocument.insertDocument( vInsertion )
vDocument.insertText( "Use the replaceBookmarks(vDataSet) method to replace the bookmarks found in the sample document.

To create bookmarks you should follow the below steps:" );
vDocument.removeBookmark( "body" );

vDocument.removeBookmark( "company_logo" );

vDocument.gotoBookmark( "user" );
vDocument.insertText( "security.getUserName()" );
vDocument.removeBookmark( "user" );

// Define where and under what name you want the save the new file
// the path name should ALWAYS be the complete absolute path
// by adding the extension or the document type you also set the format (default is .docx)
// available formats/extensions are .doc, .docx, .txt and .html
var vDocumentPath = plugins.file.getDesktopFolder( ) + "/it2be-word.docx";
vDocument.save( vDocumentPath );


fontKerning
Number  fontKerning
Get/Set the textFont kerning for the rest of the document.
Returns
Number  kerning double

Supported Clients
SmartClient, WebClient, NGClient


fontSpacing
Number  fontSpacing
Get/Set the textFont spacing
Returns
Number  spacing double

Supported Clients
SmartClient, WebClient, NGClient


importKeepSourceFormatting
Number  importKeepSourceFormatting
Get/Set to keep source formatting for the imported text
Returns
Number  format int

Supported Clients
SmartClient, WebClient, NGClient


importUseDestionationStyles
Number  importUseDestionationStyles
Get/Set to the current style for the imported text
Returns
Number  style int

Supported Clients
SmartClient, WebClient, NGClient


removeEmptyParagraphsFromMailmerge
Boolean  removeEmptyParagraphsFromMailmerge
Specifies whether paragraphs that contained mail merge fields with no data should be removed from the document. When this option is set, paragraphs which contain region start and end merge fields which are otherwise empty are also removed.
Returns
Boolean  remove boolean

Supported Clients
SmartClient, WebClient, NGClient


removeUnusedFieldsFromMailmerge
Boolean  removeUnusedFieldsFromMailmerge
Specifies whether unused merge fields should be removed from the document.
Returns
Boolean  remove boolean

Supported Clients
SmartClient, WebClient, NGClient


surpressBlankLinesFromMailmerge
Boolean  surpressBlankLinesFromMailmerge
Surpress blank lines from the mailmerge
Returns
Boolean  surpress boolean

Supported Clients
SmartClient, WebClient, NGClient

Servoy Methods Details


appendDocument
void  appendDocument( IWDocument, Number, Boolean )
Append a document to the current document
Parameters
IWDocument  document  the document
Number  importFormatMode  the import format mode
Boolean  forceNewPage  the force new page

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


appendDocument
void  appendDocument( IWDocument, Number )
Append a document to the current document
Parameters
IWDocument  document  the document
Number  importFormatMode  the import format mode

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


appendDocument
void  appendDocument( IWDocument, Boolean )
Append a document to the current document
Parameters
IWDocument  document  the document
Boolean  forceNewPage  the force new page

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


appendDocument
void  appendDocument( IWDocument )
Append a document to the current document
Parameters
IWDocument  document  the document

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


clone
IWDocument  clone( )
Clone a document
Returns
IWDocument  document IWDocument

Supported Clients
SmartClient, WebClient, NGClient


convertDataSet
IWFormattedDataSet  convertDataSet( JSDataSet )
Convert a JSDataSet to a FormattedDataSet
Parameters
JSDataSet  set  the set

Returns
IWFormattedDataSet  set IWFormattedDataSet

Supported Clients
SmartClient, WebClient, NGClient


createChart
IWChart  createChart( Number, Number, Number )
Create a chart
Parameters
Number  chartType  the chart type
Number  width  the width
Number  height  the height

Returns
IWChart  IWChart the chart

Supported Clients
SmartClient, WebClient, NGClient

Sample
/** @type {plugins.it2be_word.IWDocument} */
var vDocument;
/** @type {plugins.it2be_word.IWChart} */
var vChart;
/** @type {plugins.it2be_word.IWChartSeries} */
var vChartSeries;
/** @type {Array<String>} */
var vCategories;

// Create the Word document
vDocument = plugins.it2be_word.createDocument( );

// Create the chart
vChart = vDocument.createChart( plugins.it2be_word.CHART_TYPE.LINE, 432, 252 );

// Create an array with ALL the categories you want to set
vCategories = [ "AW Category 1", "AW Category 2" ];

// Adding new series.
// Arrays must not be empty and arrays must be the same size.
vChart.addCategories( "AW Series 1", vCategories, [ 1, 2 ] );
vChart.addCategories( "AW Series 2", vCategories, [ 3, 4 ] );
vChart.addCategories( "AW Series 3", vCategories, [ 5, 6 ] );
vChartSeries = vChart.addCategories( "AW Series 4", vCategories, [ 7, 8 ] );

vChartSeries.smooth = true;

// Move to the start of the document
vDocument.gotoStart( );

// Insert the chart now
vDocument.insertChart( vChart );

// Define where and under what name you want the save the new file
// the path name should ALWAYS be the complete absolute path
vDocument.save( plugins.file.getDesktopFolder( ) + "/it2be-word.docx" );


createTable
IWTable  createTable( Object )
Create a table for the document using an Array or a (Formatted) DataSet and an optional custom header array.
Parameters
Object  set  Array[] or JSDataSet or FormattedDataSet

Returns
IWTable  table IWTable

Supported Clients
SmartClient, WebClient, NGClient

Sample
/** @type {plugins.it2be_word.IWDocument} */
var vDocument;
/** @type {plugins.it2be_word.IWTable} */
var vTable;
/** @type {Array<Object>} */
var vSet;
/** @type {Array<String>} */
var vHeader;

// Create the Word document
vDocument = plugins.it2be_word.createDocument( );

// Create the header
vHeader = [ "first name", "middle name","last name" ];

// Create the set
vSet = [ [ "Jan", "", "Aleman" ], [ "Bob", "", "Cusick" ], [ "Johan", "", "Compagner" ], [ "Ron", "van der", "Burg" ] ];

// Create the table
vTable = vDocument.createTable(vSet, vHeader);

// Move to the start of the document
vDocument.gotoStart( );

// Insert the table now
vDocument.insertTable( vTable );

// Define where and under what name you want the save the new file
// the path name should ALWAYS be the complete absolute path
// by adding the extension or the document type you also set the format (default is .docx)
// available formats/extensions are .doc, .docx, .txt and .html
vDocument.save( plugins.file.getDesktopFolder( ) + "/it2be-word.docx" );


createTable
IWTable  createTable( Object, Array<Object> )
Create a table for the document using an Array or a (Formatted) DataSet and an optional custom header array.
Parameters
Object  set  Array[] or JSDataSet or FormattedDataSet
Array<Object>  header  the header

Returns
IWTable  table IWTable

Supported Clients
SmartClient, WebClient, NGClient

Sample
/** @type {plugins.it2be_word.IWDocument} */
var vDocument;
/** @type {plugins.it2be_word.IWTable} */
var vTable;
/** @type {Array<Object>} */
var vSet;
/** @type {Array<String>} */
var vHeader;

// Create the Word document
vDocument = plugins.it2be_word.createDocument( );

// Create the header
vHeader = [ "first name", "middle name","last name" ];

// Create the set
vSet = [ [ "Jan", "", "Aleman" ], [ "Bob", "", "Cusick" ], [ "Johan", "", "Compagner" ], [ "Ron", "van der", "Burg" ] ];

// Create the table
vTable = vDocument.createTable(vSet, vHeader);

// Move to the start of the document
vDocument.gotoStart( );

// Insert the table now
vDocument.insertTable( vTable );

// Define where and under what name you want the save the new file
// the path name should ALWAYS be the complete absolute path
// by adding the extension or the document type you also set the format (default is .docx)
// available formats/extensions are .doc, .docx, .txt and .html
vDocument.save( plugins.file.getDesktopFolder( ) + "/it2be-word.docx" );


getBookmarks
Array<IWBookmark>  getBookmarks( )
Returns an array with all the bookmarks (names and text) available.
Returns
Array<IWBookmark>  bookmarks IWBookmark[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve all bookmarks
var bookmarks = vDocument.getBookmarks();
var bookmark;
var index;

// Loop through your bookmarks
for (index = 0 ; index < bookmarks.length ; index++) {
bookmark = bookmarks[index];

// When using the IWBookmark like this the name (String value) is returned
application.output(bookmark);

// Or use the IWBookmark.getName() and IWBookmark.getText() methods
application.output(bookmark.getName());
application.output(bookmark.getText());


getDocument
Document  getDocument( )
TODO create description
Returns
Document  

Supported Clients
SmartClient, WebClient, NGClient


getFontSize
Number  getFontSize( )
Get the textFont size
Returns
Number  size double

Supported Clients
SmartClient, WebClient, NGClient


getMailMergeFieldNames
Array<String>  getMailMergeFieldNames( )
Get the names of the mail merge fields
Returns
Array<String>  names String[]

Supported Clients
SmartClient, WebClient, NGClient


gotoBookmark
void  gotoBookmark( String )
Go to the bookmark by name.
Parameters
String  bookmark  the bookmark

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Go to the bookmark by name.
// Important: Sample documents are stored in a server folder but your (smart) client needs locally stored documents!

// Sample documents are stored in the application_server/docs folder
var vSamplePath = "../application_server/docs/it2be-word";
if ( application.getOSName( ).indexOf( "Mac" ) > -1 ) {
vSamplePath = "../../../" + vSamplePath;
}

// Create the Word document with the selected original
var vDocument = plugins.it2be_word.openDocument( vSamplePath + "/Bookmarks.dot" );
var vInsertion = plugins.it2be_word.openDocument( vSamplePath + "/Insertion.doc" );

//go to the selected bookmark, insert object and remove bookmark
/** @type {String} */
var text = utils.dateFormat( new Date( ), i18n.getDefaultDateFormat( ) );

vDocument.gotoBookmark( "date" );
vDocument.textFont = "Courier,2,12";
vDocument.fontColor = "#ff0000";
vDocument.insertText( text );
vDocument.removeBookmark( "date" );

vDocument.gotoBookmark( "company_name" );
vDocument.textFont = "Courier,2,12";
vDocument.insertText( "IT2BE" );
vDocument.removeBookmark( "company_name" );

vDocument.gotoBookmark( "fullname" );
vDocument.textFont = "Courier,2,12";
vDocument.insertText( "Marcel Trapman" );
vDocument.removeBookmark( "fullname" );

vDocument.gotoBookmark( "fax_direct" );
vDocument.textFont = "Courier,2,12";
vDocument.insertText( "+31 847 44 36 75" );
vDocument.removeBookmark( "fax_direct" );

vDocument.gotoBookmark( "firstname" );
vDocument.textFont = "Courier,2,12";
vDocument.insertText( "Marcel," );
vDocument.removeBookmark( "firstname" );

vDocument.gotoBookmark( "body" );
vDocument.insertDocument( vInsertion )
vDocument.insertText( "Use the replaceBookmarks(vDataSet) method to replace the bookmarks found in the sample document.

To create bookmarks you should follow the below steps:" );
vDocument.removeBookmark( "body" );

vDocument.removeBookmark( "company_logo" );

vDocument.gotoBookmark( "user" );
vDocument.insertText( "security.getUserName()" );
vDocument.removeBookmark( "user" );

// Define where and under what name you want the save the new file
// the path name should ALWAYS be the complete absolute path
// by adding the extension or the document type you also set the format (default is .docx)
// available formats/extensions are .doc, .docx, .txt and .html
var vDocumentPath = plugins.file.getDesktopFolder( ) + "/it2be-word.docx";
vDocument.save( vDocumentPath );


gotoEnd
void  gotoEnd( )
Go to the end of the document.
Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


gotoStart
void  gotoStart( )
Go to the beginning of the document.
Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


insertAlignment
void  insertAlignment( Number )
Insert the alignment for the rest of the document.
Parameters
Number  alignment  the alignment

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


insertBookmark
void  insertBookmark( String, String )
Insert a bookmark at the selected position.
Parameters
String  bookmark  the bookmark
String  text  the text

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


insertChart
void  insertChart( IWChart )
Insert an OOXML chart (limited to document types supporting this type of chart)
Parameters
IWChart  chart  the IWChart

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
/** @type {plugins.it2be_word.IWDocument} */
var vDocument;
/** @type {plugins.it2be_word.IWChart} */
var vChart;
/** @type {plugins.it2be_word.IWChartSeries} */
var vChartSeries;
/** @type {Array<String>} */
var vCategories;

// Create the Word document
vDocument = plugins.it2be_word.createDocument( );

// Create the chart
vChart = vDocument.createChart( plugins.it2be_word.CHART_TYPE.LINE, 432, 252 );

// Create an array with ALL the categories you want to set
vCategories = [ "AW Category 1", "AW Category 2" ];

// Adding new series.
// Arrays must not be empty and arrays must be the same size.
vChart.addCategories( "AW Series 1", vCategories, [ 1, 2 ] );
vChart.addCategories( "AW Series 2", vCategories, [ 3, 4 ] );
vChart.addCategories( "AW Series 3", vCategories, [ 5, 6 ] );
vChartSeries = vChart.addCategories( "AW Series 4", vCategories, [ 7, 8 ] );

vChartSeries.smooth = true;

// Move to the start of the document
vDocument.gotoStart( );

// Insert the chart now
vDocument.insertChart( vChart );

// Define where and under what name you want the save the new file
// the path name should ALWAYS be the complete absolute path
vDocument.save( plugins.file.getDesktopFolder( ) + "/it2be-word.docx" );


insertCheckbox
void  insertCheckbox( String, Boolean, Number )
Insert a checkbox at the selected position by name, value and size.
Parameters
String  name  the name
Boolean  value  the value
Number  size  the size

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


insertDocument
void  insertDocument( IWDocument )
Insert a Document to the existing document (created with createDocument(.) or openDocument(...)...
Parameters
IWDocument  document  the document

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Insert a Document to the existing document (created with createDocument(.) or openDocument(...)...
// Important: Sample documents are stored in a server folder but your (smart) client needs locally stored documents!

// Sample documents are stored in the application_server/docs folder
var vSamplePath = "../application_server/docs/it2be-word";
if ( application.getOSName( ).indexOf( "Mac" ) > -1 ) {
vSamplePath = "../../../" + vSamplePath;
}

// Create the Word document with the selected original
var vDocument = plugins.it2be_word.openDocument( vSamplePath + "/Bookmarks.dot" );
var vInsertion = plugins.it2be_word.openDocument( vSamplePath + "/Insertion.doc" );

//go to the selected bookmark, insert object and remove bookmark
/** @type {String} */
var text = utils.dateFormat( new Date( ), i18n.getDefaultDateFormat( ) );

vDocument.gotoBookmark( "date" );
vDocument.textFont = "Courier,2,12";
vDocument.fontColor = "#ff0000";
vDocument.insertText( text );
vDocument.removeBookmark( "date" );

vDocument.gotoBookmark( "company_name" );
vDocument.textFont = "Courier,2,12";
vDocument.insertText( "IT2BE" );
vDocument.removeBookmark( "company_name" );

vDocument.gotoBookmark( "fullname" );
vDocument.textFont = "Courier,2,12";
vDocument.insertText( "Marcel Trapman" );
vDocument.removeBookmark( "fullname" );

vDocument.gotoBookmark( "fax_direct" );
vDocument.textFont = "Courier,2,12";
vDocument.insertText( "+31 847 44 36 75" );
vDocument.removeBookmark( "fax_direct" );

vDocument.gotoBookmark( "firstname" );
vDocument.textFont = "Courier,2,12";
vDocument.insertText( "Marcel," );
vDocument.removeBookmark( "firstname" );

vDocument.gotoBookmark( "body" );
vDocument.insertDocument( vInsertion )
vDocument.insertText( "Use the replaceBookmarks(vDataSet) method to replace the bookmarks found in the sample document.

To create bookmarks you should follow the below steps:" );
vDocument.removeBookmark( "body" );

vDocument.removeBookmark( "company_logo" );

vDocument.gotoBookmark( "user" );
vDocument.insertText( "security.getUserName()" );
vDocument.removeBookmark( "user" );

// Define where and under what name you want the save the new file
// the path name should ALWAYS be the complete absolute path
// by adding the extension or the document type you also set the format (default is .docx)
// available formats/extensions are .doc, .docx, .txt and .html
var vDocumentPath = plugins.file.getDesktopFolder( ) + "/it2be-word.docx";
vDocument.save( vDocumentPath );


insertDocument
void  insertDocument( IWDocument, Number )
Insert a Document to the existing document (created with createDocument(.) or openDocument(...)...
Parameters
IWDocument  document  the document
Number  importFormatMode  the import format mode

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Insert a Document to the existing document (created with createDocument(.) or openDocument(...)...
// Important: Sample documents are stored in a server folder but your (smart) client needs locally stored documents!

// Sample documents are stored in the application_server/docs folder
var vSamplePath = "../application_server/docs/it2be-word";
if ( application.getOSName( ).indexOf( "Mac" ) > -1 ) {
vSamplePath = "../../../" + vSamplePath;
}

// Create the Word document with the selected original
var vDocument = plugins.it2be_word.openDocument( vSamplePath + "/Bookmarks.dot" );
var vInsertion = plugins.it2be_word.openDocument( vSamplePath + "/Insertion.doc" );

//go to the selected bookmark, insert object and remove bookmark
/** @type {String} */
var text = utils.dateFormat( new Date( ), i18n.getDefaultDateFormat( ) );

vDocument.gotoBookmark( "date" );
vDocument.textFont = "Courier,2,12";
vDocument.fontColor = "#ff0000";
vDocument.insertText( text );
vDocument.removeBookmark( "date" );

vDocument.gotoBookmark( "company_name" );
vDocument.textFont = "Courier,2,12";
vDocument.insertText( "IT2BE" );
vDocument.removeBookmark( "company_name" );

vDocument.gotoBookmark( "fullname" );
vDocument.textFont = "Courier,2,12";
vDocument.insertText( "Marcel Trapman" );
vDocument.removeBookmark( "fullname" );

vDocument.gotoBookmark( "fax_direct" );
vDocument.textFont = "Courier,2,12";
vDocument.insertText( "+31 847 44 36 75" );
vDocument.removeBookmark( "fax_direct" );

vDocument.gotoBookmark( "firstname" );
vDocument.textFont = "Courier,2,12";
vDocument.insertText( "Marcel," );
vDocument.removeBookmark( "firstname" );

vDocument.gotoBookmark( "body" );
vDocument.insertDocument( vInsertion )
vDocument.insertText( "Use the replaceBookmarks(vDataSet) method to replace the bookmarks found in the sample document.

To create bookmarks you should follow the below steps:" );
vDocument.removeBookmark( "body" );

vDocument.removeBookmark( "company_logo" );

vDocument.gotoBookmark( "user" );
vDocument.insertText( "security.getUserName()" );
vDocument.removeBookmark( "user" );

// Define where and under what name you want the save the new file
// the path name should ALWAYS be the complete absolute path
// by adding the extension or the document type you also set the format (default is .docx)
// available formats/extensions are .doc, .docx, .txt and .html
var vDocumentPath = plugins.file.getDesktopFolder( ) + "/it2be-word.docx";
vDocument.save( vDocumentPath );


insertField
void  insertField( String, String )
Insert a field at the selected position.
Parameters
String  code  the field code
String  value  the field value

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


insertHtml
void  insertHtml( String )
Insert a html string at the selected position.
Parameters
String  html  the html

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


insertImage
void  insertImage( Object )
Insert an image (by path or media type) at the selected position (optional width and height pixels (int) or percentage (string).
Parameters
Object  image  filePath:String or media:byte[]

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


insertImage
void  insertImage( Object, Number, Number )
Insert an image (by path or media type) at the selected position (optional width and height pixels (int) or percentage (string).
Parameters
Object  image  filePath:String or media:byte[]
Number  width  the width
Number  height  the height

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


insertImage
void  insertImage( Object, String, String )
Insert an image (by path or media type) at the selected position (optional width and height pixels (int) or percentage (string).
Parameters
Object  image  filePath:String or media:byte[]
String  width  the width
String  height  the height

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


insertMailMergeField
void  insertMailMergeField( String, String, String, Number, Number, Number )
Insert a mail merge field at the selected position.
Parameters
String  name:String  the name
String  font:String  the font
String  color:String  the color
Number  kerning:int  the kerning
Number  spacing:int  the spacing
Number  underline:int  the underline

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


insertPagebreak
void  insertPagebreak( )
Insert a pagebreak at the selected position.
Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


insertStyleIdentifier
void  insertStyleIdentifier( Number )
Insert a Style Identifier to set a style for the rest of the document.
Parameters
Number  identifier  the identifier

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


insertTable
void  insertTable( IWTable )
Insert a table at the selected position.
Parameters
IWTable  table  the table

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
/** @type {plugins.it2be_word.IWDocument} */
var vDocument;
/** @type {plugins.it2be_word.IWTable} */
var vTable;
/** @type {Array<Object>} */
var vSet;
/** @type {Array<String>} */
var vHeader;

// Create the Word document
vDocument = plugins.it2be_word.createDocument( );

// Create the header
vHeader = [ "first name", "middle name","last name" ];

// Create the set
vSet = [ [ "Jan", "", "Aleman" ], [ "Bob", "", "Cusick" ], [ "Johan", "", "Compagner" ], [ "Ron", "van der", "Burg" ] ];

// Create the table
vTable = vDocument.createTable(vSet, vHeader);

// Move to the start of the document
vDocument.gotoStart( );

// Insert the table now
vDocument.insertTable( vTable );

// Define where and under what name you want the save the new file
// the path name should ALWAYS be the complete absolute path
// by adding the extension or the document type you also set the format (default is .docx)
// available formats/extensions are .doc, .docx, .txt and .html
vDocument.save( plugins.file.getDesktopFolder( ) + "/it2be-word.docx" );


insertTableOfContents
void  insertTableOfContents( String )
Inserts a TOC (table of contents) field into the document.
Parameters
String  switches  the switches

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// This method inserts a TOC (table of contents) field into the document at
// the current position.
// A table of contents in a Word document can be built in a number of ways
// and formatted using a variety of options. The way the table is built and
// displayed by Microsoft Word is controlled by the field switches.
// The easiest way to specify the switches is to insert and configure a table of
// contents into a Word document using the Insert->Reference->Index and Tables menu,
// then switch display of field codes on to see the switches. You can press Alt+F9 in
// Microsoft Word to toggle display of field codes on or off.
// If you insert a table of contents using this method and then open the file
// in Microsoft Word, you will not see the table of contents because the TOC field
// has not yet been updated.
// In Microsoft Word, fields are not automatically updated when a document is opened,
// but you can update fields in a document at any time by pressing F9.


insertText
void  insertText( String, String, String, Number, Number, Number )
Insert text at the selected position.
Parameters
String  value:String  or String[]
String  font:String  the font
String  color:String  the color
Number  kerning:int  the kerning
Number  spacing:int  the spacing
Number  underline:int  the underline

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


mailMerge
void  mailMerge( Object )
Mailmerge the document with a Dataset or Foundset.
Parameters
Object  set  JSFoundSet or JSDataSet

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Mailmerge the document with a Dataset or Foundset.
// Important: Sample documents are stored in a server folder but your (smart) client needs locally stored documents!

// Create a dataset
var vQuery = "SELECT * FROM it2be_companies c, it2be_contacts o WHERE c.it2be_companiesid=o.it2be_companiesid";
var vDataSet = databaseManager.getDataSetByQuery( databaseManager.getDataSourceServerName( controller.getDataSource( ) ), vQuery, null, -1 );

// Stop executing this method when the record is empty and show an error dialog
if ( !vDataSet || vDataSet.getMaxRowIndex( ) == 0 ) {
plugins.dialogs.showErrorDialog( "Error.", "There are no records!", "OK" );
Return;
}

// Sample documents are stored in the application_server/docs folder
var vSamplePath = "../application_server/docs/it2be-word";
if ( application.getOSName( ).indexOf( "Mac" ) > -1 ) {
vSamplePath = "../../../" + vSamplePath;
}

// Define the path to the original
// The path name should ALWAYS be the complete absolute path
var vOriginal = vSamplePath + "/Mailmerge.dot";

// Create the Word document with the selected original
// When you use images you need to set the field type to Image (prefix the name with 'Image:')
var vDocument = plugins.it2be_word.openDocument( vOriginal );

// Replace the 'generic' bookmarks
/** @type {String} */
var text = utils.dateFormat( new Date( ), i18n.getDefaultDateFormat( ) );

vDocument.replaceBookmark( "body", "This is a mail merge sample.

There is nothing more to it than creating a template with merge-fields:" );
vDocument.replaceBookmark( "date", text );
vDocument.replaceBookmark( "user", "security.getUserName()" );

// Mailmerge the document with a foundset or dataset
vDocument.mailMerge( vDataSet );

// Define where and under what name you want the save the new file
// the path name should ALWAYS be the complete absolute path
// by adding the extension or the document type you also set the format (default is .docx)
// available formats/extensions are .doc, .docx, .txt and .html
var vDocumentPath = plugins.file.getDesktopFolder( ) + "/it2be-word.docx";
vDocument.save( vDocumentPath );


mailMergeRegions
void  mailMergeRegions( DataTable )
Mailmerge the document with regions.
Parameters
DataTable  dataTable  Aspose DataTable created from a DataSet or a FoundSet

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Mailmerge the document with regions.
// Important: Sample documents are stored in a server folder but your (smart) client needs locally stored documents!

// Create a dataset
var vQuery = "SELECT * FROM it2be_companies c, it2be_contacts o WHERE c.it2be_companiesid=o.it2be_companiesid";
var vDataSet = databaseManager.getDataSetByQuery( databaseManager.getDataSourceServerName( controller.getDataSource( ) ), vQuery, null, -1 );

// Create an Aspose DataTable from the dataset
var vAsposeTable = plugins.it2be_word.convertToAsposeDataTable(vDataSet, "MyDataSet"); // Note: The second argument in this call must match the name of the merge region in the Word document.

// Stop executing this method when the record is empty and show an error dialog
if ( !vDataSet || vDataSet.getMaxRowIndex( ) == 0 ) {
plugins.dialogs.showErrorDialog( "Error.", "There are no records!", "OK" );
Return;
}

// Sample documents are stored in the application_server/docs folder
var vSamplePath = "../application_server/docs/it2be-word";
if ( application.getOSName( ).indexOf( "Mac" ) > -1 ) {
vSamplePath = "../../../" + vSamplePath;
}

// Define the path to the original
// The path name should ALWAYS be the complete absolute path
var vOriginal = vSamplePath + "/Mailmerge.dot";

// Create the Word document with the selected original
// When you use images you need to set the field type to Image (prefix the name with 'Image:')
var vDocument = plugins.it2be_word.openDocument( vOriginal );

// Replace the 'generic' bookmarks
/** @type {String} */
var text = utils.dateFormat( new Date( ), i18n.getDefaultDateFormat( ) );

vDocument.replaceBookmark( "body", "This is a mail merge sample.

There is nothing more to it than creating a template with merge-fields:" );
vDocument.replaceBookmark( "date", text );
vDocument.replaceBookmark( "user", "security.getUserName()" );

// Mailmerge the document with regions with a foundset or dataset
vDocument.mailMergeRegions( vAsposeTable );

// Define where and under what name you want the save the new file
// the path name should ALWAYS be the complete absolute path
// by adding the extension or the document type you also set the format (default is .docx)
// available formats/extensions are .doc, .docx, .txt and .html
var vDocumentPath = plugins.file.getDesktopFolder( ) + "/it2be-word.docx";
vDocument.save( vDocumentPath );


mergeLinqTemplate
void  mergeLinqTemplate( LinqDataSource, Array<String> )
TODO create description
Parameters
LinqDataSource  linqDataSource
Array<String>  additionalClasses

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


mergeLinqTemplate
void  mergeLinqTemplate( LinqDataSource )
TODO create description
Parameters
LinqDataSource  linqDataSource

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


mergeLinqTemplate
void  mergeLinqTemplate( Array<LinqDataSource>, Array<String> )
TODO create description
Parameters
Array<LinqDataSource>  linqDataSources
Array<String>  additionalClasses

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


mergeLinqTemplate
void  mergeLinqTemplate( Array<LinqDataSource> )
TODO create description
Parameters
Array<LinqDataSource>  linqDataSources

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


moveToFirstFooter
void  moveToFirstFooter( Number )
Create a footer for the first page after moving.
Parameters
Number  distance  the distance

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


moveToFirstFooter
void  moveToFirstFooter( )
Create a footer for the first page after moving.
Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


moveToFirstHeader
void  moveToFirstHeader( )
Create a header for the first page after moving.
Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


moveToFirstHeader
void  moveToFirstHeader( Number )
Create a header for the first page after moving.
Parameters
Number  distance  the distance

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


moveToPrimaryFooter
void  moveToPrimaryFooter( Number )
Create a footer for all pages after moving.
Parameters
Number  distance  the distance

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


moveToPrimaryFooter
void  moveToPrimaryFooter( )
Create a footer for all pages after moving.
Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


moveToPrimaryHeader
void  moveToPrimaryHeader( Number )
Create a header for all pages after moving.
Parameters
Number  distance  the distance

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


moveToPrimaryHeader
void  moveToPrimaryHeader( )
Create a header for all pages after moving.
Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


removeBookmark
void  removeBookmark( String )
Remove the bookmark by name.
Parameters
String  bookmark  the bookmark

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


replaceBookmark
void  replaceBookmark( String, String )
Replace the named bookmark with the entered text.
Parameters
String  bookmark  the bookmark
String  text  the text

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Replace the bookmarks with the columnnames and row values (arrays), dataset, foundset or record.
// Important: Sample documents are stored in a server folder but your (smart) client needs locally stored documents!

// Create a dataset
var vQuery = "SELECT c.companyname AS company_name,o.firstname,o.lastname,o.fullname,o.fax_direct FROM it2be_companies c, it2be_contacts o WHERE c.it2be_companiesid=o.it2be_companiesid";
var vDataSet = databaseManager.getDataSetByQuery( databaseManager.getDataSourceServerName( controller.getDataSource( ) ), vQuery, null, -1 );

// Stop executing this method when the record is empty and show an error dialog
if ( !vDataSet || vDataSet.getMaxRowIndex( ) == 0 ) {
plugins.dialogs.showErrorDialog( "Error.", "There are no records!", "OK" );
Return;
}

// Sample documents are stored in the application_server/docs folder
var vSamplePath = "../application_server/docs/it2be-word";
if ( application.getOSName( ).indexOf( "Mac" ) > -1 ) {
vSamplePath = "../../../" + vSamplePath;
}

// Define the path to the original
// The path name should ALWAYS be the complete absolute path
var vOriginal = vSamplePath + "/Bookmarks.dot";

// Create the Word document with the selected original
var vDocument = plugins.it2be_word.openDocument( vOriginal );

// When you want to be notified (in the log file) of missing bookmarks
// you should set the debugMissingBookmarks property
// IMPORTANT always place the method BEFORE processing your bookmarks
vDocument.debugMissingBookmarks = true;

// Replace the 'generic' bookmarks
/** @type {String} */
var text = utils.dateFormat( new Date( ), i18n.getDefaultDateFormat( ) );

vDocument.replaceBookmark( "body", "Use the replaceBookmarks(dataset) method to replace the bookmarks found in the sample document.

To create bookmarks you should follow the below steps:" );
vDocument.replaceBookmark( "date", text );
vDocument.replaceBookmark( "user", "security.getUserName()" );

// Replace the bookmarks based on the names of the columns in the record
vDocument.replaceBookmarks( vDataSet );

// Define where and under what name you want the save the new file
// the path name should ALWAYS be the complete absolute path
// by adding the extension or the document type you also set the format (default is .docx)
// available formats/extensions are .doc, .docx, .txt and .html
var vDocumentPath = plugins.file.getDesktopFolder( ) + "/it2be-word.doc";
vDocument.save( vDocumentPath );


replaceBookmarkWithCheckbox
void  replaceBookmarkWithCheckbox( String, String, Boolean, Number )
Replace the named bookmark with a checkbox by name, value and size.
Parameters
String  bookmark  the bookmark
String  name  the name
Boolean  value  the value
Number  size  the size

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


replaceBookmarkWithImage
void  replaceBookmarkWithImage( String, Object, Number, Number )
Replace the named bookmark with an image.
Parameters
String  bookmark  the bookmark
Object  image  filePath:String or media:byte[]
Number  width  the width
Number  height  the height

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


replaceBookmarkWithImage
void  replaceBookmarkWithImage( String, Object )
Replace the named bookmark with an image.
Parameters
String  bookmark  the bookmark
Object  image  filePath:String or media:byte[]

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


replaceBookmarkWithPageBreak
void  replaceBookmarkWithPageBreak( String )
Replace the named bookmark with a page break.
Parameters
String  bookmark  the bookmark

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


replaceBookmarkWithTable
void  replaceBookmarkWithTable( String, IWTable )
Replace the named bookmark with a table.
Parameters
String  bookmark  the bookmark
IWTable  table  the table

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


replaceBookmarks
void  replaceBookmarks( Object )
Replace the bookmarks with the columnnames and row values (arrays), dataset, foundset or record.
Parameters
Object  set  String[] or JSRecord or JSFoundSet or JSDataSet

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Replace the bookmarks with the columnnames and row values (arrays), dataset, foundset or record.
// Important: Sample documents are stored in a server folder but your (smart) client needs locally stored documents!

// Create a dataset
var vQuery = "SELECT c.companyname AS company_name,o.firstname,o.lastname,o.fullname,o.fax_direct FROM it2be_companies c, it2be_contacts o WHERE c.it2be_companiesid=o.it2be_companiesid";
var vDataSet = databaseManager.getDataSetByQuery( databaseManager.getDataSourceServerName( controller.getDataSource( ) ), vQuery, null, -1 );

// Stop executing this method when the record is empty and show an error dialog
if ( !vDataSet || vDataSet.getMaxRowIndex( ) == 0 ) {
plugins.dialogs.showErrorDialog( "Error.", "There are no records!", "OK" );
Return;
}

// Sample documents are stored in the application_server/docs folder
var vSamplePath = "../application_server/docs/it2be-word";
if ( application.getOSName( ).indexOf( "Mac" ) > -1 ) {
vSamplePath = "../../../" + vSamplePath;
}

// Define the path to the original
// The path name should ALWAYS be the complete absolute path
var vOriginal = vSamplePath + "/Bookmarks.dot";

// Create the Word document with the selected original
var vDocument = plugins.it2be_word.openDocument( vOriginal );

// When you want to be notified (in the log file) of missing bookmarks
// you should set the debugMissingBookmarks property
// IMPORTANT always place the method BEFORE processing your bookmarks
vDocument.debugMissingBookmarks = true;

// Replace the 'generic' bookmarks
/** @type {String} */
var text = utils.dateFormat( new Date( ), i18n.getDefaultDateFormat( ) );

vDocument.replaceBookmark( "body", "Use the replaceBookmarks(dataset) method to replace the bookmarks found in the sample document.

To create bookmarks you should follow the below steps:" );
vDocument.replaceBookmark( "date", text );
vDocument.replaceBookmark( "user", "security.getUserName()" );

// Replace the bookmarks based on the names of the columns in the record
vDocument.replaceBookmarks( vDataSet );

// Define where and under what name you want the save the new file
// the path name should ALWAYS be the complete absolute path
// by adding the extension or the document type you also set the format (default is .docx)
// available formats/extensions are .doc, .docx, .txt and .html
var vDocumentPath = plugins.file.getDesktopFolder( ) + "/it2be-word.doc";
vDocument.save( vDocumentPath );


replaceBookmarks
void  replaceBookmarks( Array<String>, Array<Object> )
Replace the bookmarks with the columnnames and row values (arrays), dataset, foundset or record.
Parameters
Array<String>  columns  the columns
Array<Object>  set  String[] or JSRecord or JSFoundSet or JSDataSet

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Replace the bookmarks with the columnnames and row values (arrays), dataset, foundset or record.
// Important: Sample documents are stored in a server folder but your (smart) client needs locally stored documents!

// Create a dataset
var vQuery = "SELECT c.companyname AS company_name,o.firstname,o.lastname,o.fullname,o.fax_direct FROM it2be_companies c, it2be_contacts o WHERE c.it2be_companiesid=o.it2be_companiesid";
var vDataSet = databaseManager.getDataSetByQuery( databaseManager.getDataSourceServerName( controller.getDataSource( ) ), vQuery, null, -1 );

// Stop executing this method when the record is empty and show an error dialog
if ( !vDataSet || vDataSet.getMaxRowIndex( ) == 0 ) {
plugins.dialogs.showErrorDialog( "Error.", "There are no records!", "OK" );
Return;
}

// Sample documents are stored in the application_server/docs folder
var vSamplePath = "../application_server/docs/it2be-word";
if ( application.getOSName( ).indexOf( "Mac" ) > -1 ) {
vSamplePath = "../../../" + vSamplePath;
}

// Define the path to the original
// The path name should ALWAYS be the complete absolute path
var vOriginal = vSamplePath + "/Bookmarks.dot";

// Create the Word document with the selected original
var vDocument = plugins.it2be_word.openDocument( vOriginal );

// When you want to be notified (in the log file) of missing bookmarks
// you should set the debugMissingBookmarks property
// IMPORTANT always place the method BEFORE processing your bookmarks
vDocument.debugMissingBookmarks = true;

// Replace the 'generic' bookmarks
/** @type {String} */
var text = utils.dateFormat( new Date( ), i18n.getDefaultDateFormat( ) );

vDocument.replaceBookmark( "body", "Use the replaceBookmarks(dataset) method to replace the bookmarks found in the sample document.

To create bookmarks you should follow the below steps:" );
vDocument.replaceBookmark( "date", text );
vDocument.replaceBookmark( "user", "security.getUserName()" );

// Replace the bookmarks based on the names of the columns in the record
vDocument.replaceBookmarks( vDataSet );

// Define where and under what name you want the save the new file
// the path name should ALWAYS be the complete absolute path
// by adding the extension or the document type you also set the format (default is .docx)
// available formats/extensions are .doc, .docx, .txt and .html
var vDocumentPath = plugins.file.getDesktopFolder( ) + "/it2be-word.doc";
vDocument.save( vDocumentPath );


replaceRegEx
void  replaceRegEx( String, String )
Replace a given regular expression with a new string value.
Parameters
String  regEx  the regex
String  value  the value

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


replaceText
void  replaceText( String, String )
Replace a given string with a new string value.
Parameters
String  oldValue  text
String  newValue  text

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


replaceTextTags
void  replaceTextTags( Object )
Replace a given tag with a a new value (tags should be the same as field names).
Parameters
Object  set  JSRecord or JSFoundSet or JSDataSet

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


replaceTextTags
void  replaceTextTags( Object, String )
Replace a given tag with a a new value (tags should be the same as field names).
Parameters
Object  set  JSRecord or JSFoundSet or JSDataSet
String  tag  the enclosing tag

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


save
String  save( String, Boolean )
Save the document with the pathname and overwrite the extension in the file path.
Parameters
String  filePath  the file path
Boolean  overwriteExtension  the overwrite extension

Returns
String  String

Supported Clients
SmartClient, WebClient, NGClient


save
String  save( String, Number )
Save the document with the pathname and document type.
Parameters
String  filePath  the file path
Number  documentType  the document type

Returns
String  String

Supported Clients
SmartClient, WebClient, NGClient


save
String  save( String, Number, String )
Save the document with the pathname, document type and password.
Parameters
String  filePath  the file path
Number  documentType  the document type
String  password  the password

Returns
String  String

Supported Clients
SmartClient, WebClient, NGClient


save
String  save( String, String )
Save the document with the pathname and password.
Parameters
String  filePath  the file path
String  password  the password

Returns
String  String

Supported Clients
SmartClient, WebClient, NGClient


save
String  save( String, Number, String, Boolean )
Save the document with the pathname, document type, password and overwrite the extension in the file path.
Parameters
String  filePath  the file path
Number  documentType  the document type
String  password  the password
Boolean  overwriteExtension  the overwrite extension

Returns
String  String

Supported Clients
SmartClient, WebClient, NGClient


save
String  save( String, String, Boolean )
Save the document with the pathname, password and overwrite the extension in the file path.
Parameters
String  filePath  the file path
String  password  the password
Boolean  overwriteExtension  the overwrite extension

Returns
String  String

Supported Clients
SmartClient, WebClient, NGClient


save
String  save( String )
Save the document with the pathname.
Parameters
String  filePath  the file path

Returns
String  String

Supported Clients
SmartClient, WebClient, NGClient


setAuthor
void  setAuthor( String )
Set author property of the document.
Parameters
String  author  the author

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


setCheckboxValue
void  setCheckboxValue( String, Boolean )
(Un)Check the checkbox
Parameters
String  name  the name
Boolean  value  the value

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


setComments
void  setComments( String )
Set comments property of the document.
Parameters
String  comments  the comments

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


setCompany
void  setCompany( String )
Set company property of the document.
Parameters
String  company  the company

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


setDifferentFirstPageHeaderFooter
void  setDifferentFirstPageHeaderFooter( Boolean )
Tell the document to use a different header and footer on the first page.
Parameters
Boolean  value  the value

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


setFontAttributes
void  setFontAttributes( String, String, Number, Number, Number )
Set the textFont attributes for the rest of the document.
Parameters
String  font  the font
String  color  the color
Number  kerning  the kerning
Number  spacing  the spacing
Number  underline  the underline

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


setFontFolder
void  setFontFolder( String, Boolean )
Set textFont folder (will override default textFont folder(s)).
Parameters
String  path  the path
Boolean  recursive  the recursive

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


setFontFolders
void  setFontFolders( Array<String>, Boolean )
Set textFont folders (will override default textFont folder(s)).
Parameters
Array<String>  paths  the paths
Boolean  recursive  the recusive

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


setKeywords
void  setKeywords( String )
Set keywords property of the document.
Parameters
String  keywords  the keywords

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


setPaperOrientationLandscape
void  setPaperOrientationLandscape( )
Set paper orientation to landscape
Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


setPaperOrientationPortrait
void  setPaperOrientationPortrait( )
Set paper orientation to portrait
Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


setPaperSize
void  setPaperSize( Number )
Set the paper size of the document.
Parameters
Number  size  the size

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


setTitle
void  setTitle( String )
Set title property of the document.
Parameters
String  title  the title

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


setVersion
void  setVersion( Number )
Set version property of the document.
Parameters
Number  version  the version

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient


updateFields
void  updateFields( )
Use the method to update the TOC (table of contents).
Returns
void  

Supported Clients
SmartClient, WebClient, NGClient