Skip to content

Instantly share code, notes, and snippets.

@aspose-words-cloud-gists
Last active August 14, 2023 08:11
Show Gist options
  • Save aspose-words-cloud-gists/a9510e4b51613f1138e7c1ec09634c4a to your computer and use it in GitHub Desktop.
Save aspose-words-cloud-gists/a9510e4b51613f1138e7c1ec09634c4a to your computer and use it in GitHub Desktop.
This gist exceeds the recommended number of files (~10). To access all files, please clone this gist.
This Gist contains Node.js code samples for Aspose.Words Cloud API
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const acceptRequest = new model.AcceptAllRevisionsRequest({
name: "Sample.docx"
});
wordsApi.acceptAllRevisions(acceptRequest)
.then((acceptRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of acceptRequest: ", acceptRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const acceptRequest = new model.AcceptAllRevisionsOnlineRequest({
document: requestDocument
});
wordsApi.acceptAllRevisionsOnline(acceptRequest)
.then((acceptRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of acceptRequest: ", acceptRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const remoteFileName = "Sample.docx";
const requestDocumentListDocumentEntries0FileReference = model.FileReference.fromRemoteFilePath(remoteFileName);
const requestDocumentListDocumentEntries0 = new model.DocumentEntry({
fileReference: requestDocumentListDocumentEntries0FileReference,
importFormatMode: "KeepSourceFormatting"
})
const requestDocumentListDocumentEntries = [
requestDocumentListDocumentEntries0
]
const requestDocumentList = new model.DocumentEntryList({
documentEntries: requestDocumentListDocumentEntries
})
const appendRequest = new model.AppendDocumentRequest({
name: remoteFileName,
documentList: requestDocumentList
});
wordsApi.appendDocument(appendRequest)
.then((appendRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of appendRequest: ", appendRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const localFile = "Sample.docx";
const requestDocument = fs.createReadStream(localFile);
const requestDocumentListDocumentEntries0FileReferenceStream = fs.createReadStream(BaseTest.localBaseTestDataFolder + localFile);
const requestDocumentListDocumentEntries0FileReference = model.FileReference.fromLocalFileContent(requestDocumentListDocumentEntries0FileReferenceStream);
const requestDocumentListDocumentEntries0 = new model.DocumentEntry({
fileReference: requestDocumentListDocumentEntries0FileReference,
importFormatMode: "KeepSourceFormatting"
})
const requestDocumentListDocumentEntries = [
requestDocumentListDocumentEntries0
]
const requestDocumentList = new model.DocumentEntryList({
documentEntries: requestDocumentListDocumentEntries
})
const appendRequest = new model.AppendDocumentOnlineRequest({
document: requestDocument,
documentList: requestDocumentList
});
wordsApi.appendDocumentOnline(appendRequest)
.then((appendRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of appendRequest: ", appendRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestStyleApply = new model.StyleApply({
styleName: "Heading 1"
})
const applyStyleRequest = new model.ApplyStyleToDocumentElementRequest({
name: "Sample.docx",
styleApply: requestStyleApply,
styledNodePath: "paragraphs/1/paragraphFormat"
});
wordsApi.applyStyleToDocumentElement(applyStyleRequest)
.then((applyStyleRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of applyStyleRequest: ", applyStyleRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const requestStyleApply = new model.StyleApply({
styleName: "Heading 1"
})
const applyStyleRequest = new model.ApplyStyleToDocumentElementOnlineRequest({
document: requestDocument,
styleApply: requestStyleApply,
styledNodePath: "paragraphs/1/paragraphFormat"
});
wordsApi.applyStyleToDocumentElementOnline(applyStyleRequest)
.then((applyStyleRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of applyStyleRequest: ", applyStyleRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestReportEngineSettingsReportBuildOptions = [
model.ReportBuildOptions.AllowMissingMembers,
model.ReportBuildOptions.RemoveEmptyParagraphs
]
const requestReportEngineSettings = new model.ReportEngineSettings({
dataSourceType: model.ReportEngineSettings.DataSourceTypeEnum.Json,
reportBuildOptions: requestReportEngineSettingsReportBuildOptions
})
const buildReportRequest = new model.BuildReportRequest({
name: "Sample.docx",
data: "Data.json",
reportEngineSettings: requestReportEngineSettings
});
wordsApi.buildReport(buildReportRequest)
.then((buildReportRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of buildReportRequest: ", buildReportRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestTemplate = fs.createReadStream("Sample.docx");
const requestReportEngineSettings = new model.ReportEngineSettings({
dataSourceType: model.ReportEngineSettings.DataSourceTypeEnum.Json,
dataSourceName: "persons"
})
const buildReportRequest = new model.BuildReportOnlineRequest({
template: requestTemplate,
data: "Data.json",
reportEngineSettings: requestReportEngineSettings
});
wordsApi.buildReportOnline(buildReportRequest)
.then((buildReportRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of buildReportRequest: ", buildReportRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const classifyRequest = new model.ClassifyRequest({
text: "Try text classification",
bestClassesCount: "3"
});
wordsApi.classify(classifyRequest)
.then((classifyRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of classifyRequest: ", classifyRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const classifyRequest = new model.ClassifyDocumentRequest({
name: "Sample.docx",
bestClassesCount: "3"
});
wordsApi.classifyDocument(classifyRequest)
.then((classifyRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of classifyRequest: ", classifyRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const classifyRequest = new model.ClassifyDocumentOnlineRequest({
document: requestDocument,
bestClassesCount: "3"
});
wordsApi.classifyDocumentOnline(classifyRequest)
.then((classifyRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of classifyRequest: ", classifyRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestCompareData = new model.CompareData({
author: "author",
comparingWithDocument: "TestCompareDocument2.doc",
dateTime: new Date('2015-10-26T00:00:00Z')
})
const compareRequest = new model.CompareDocumentRequest({
name: "TestCompareDocument1.doc",
compareData: requestCompareData,
destFileName: "CompareDocumentOut.doc"
});
wordsApi.compareDocument(compareRequest)
.then((compareRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of compareRequest: ", compareRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("compareTestDoc1.doc");
const requestCompareData = new model.CompareData({
author: "author",
comparingWithDocument: "TestCompareDocument2.doc",
dateTime: new Date('2015-10-26T00:00:00Z')
})
const requestComparingDocument = fs.createReadStream("compareTestDoc2.doc");
const compareRequest = new model.CompareDocumentOnlineRequest({
document: requestDocument,
compareData: requestCompareData,
comparingDocument: requestComparingDocument,
destFileName: "CompareDocumentOut.doc"
});
wordsApi.compareDocumentOnline(compareRequest)
.then((compareRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of compareRequest: ", compareRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestCompressOptions = new model.CompressOptions({
})
const compressDocument = new model.CompressDocumentRequest({
name: "Sample.docx",
compressOptions: requestCompressOptions
});
wordsApi.compressDocument(compressDocument)
.then((compressDocumentResult) => {
// tslint:disable-next-line:no-console
console.log("Result of CompressDocument: ", compressDocumentResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("TestCompress.docx");
const requestCompressOptions = new model.CompressOptions({
})
const compressDocumentOnline = new model.CompressDocumentOnlineRequest({
document: requestDocument,
compressOptions: requestCompressOptions
});
wordsApi.compressDocumentOnline(compressDocumentOnline)
.then((compressDocumentOnlineResult) => {
// tslint:disable-next-line:no-console
console.log("Result of CompressDocumentOnline: ", compressDocumentOnlineResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const convertRequest = new model.ConvertDocumentRequest({
document: requestDocument,
format: "pdf"
});
wordsApi.convertDocument(convertRequest)
.then((convertRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of convertRequest: ", convertRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const convertRequest = new model.ConvertDocumentRequest({
document: requestDocument,
format: "pdf"
});
wordsApi.convertDocument(convertRequest)
.then((convertRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of convertRequest: ", convertRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const convertRequest = new model.ConvertDocumentRequest({
document: requestDocument,
format: "pdf"
});
wordsApi.convertDocument(convertRequest)
.then((convertRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of convertRequest: ", convertRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const copyRequest = new model.CopyFileRequest({
destPath: "Copy.docx",
srcPath: "Sample.docx"
});
wordsApi.copyFile(copyRequest)
.then((copyRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of copyRequest: ", copyRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const folderToCopy = "/TestCopyFolder";
const copyRequest = new model.CopyFolderRequest({
destPath: folderToCopy + "Dest",
srcPath: folderToCopy + "Src"
});
wordsApi.copyFolder(copyRequest)
.then((copyRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of copyRequest: ", copyRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestStyleCopy = new model.StyleCopy({
styleName: "Heading 1"
})
const copyRequest = new model.CopyStyleRequest({
name: "Sample.docx",
styleCopy: requestStyleCopy
});
wordsApi.copyStyle(copyRequest)
.then((copyRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of copyRequest: ", copyRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const requestStyleCopy = new model.StyleCopy({
styleName: "Heading 1"
})
const copyRequest = new model.CopyStyleOnlineRequest({
document: requestDocument,
styleCopy: requestStyleCopy
});
wordsApi.copyStyleOnline(copyRequest)
.then((copyRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of copyRequest: ", copyRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const copyRequest = new model.CopyStylesFromTemplateRequest({
name: "Sample.docx",
templateName: "StyleTemplate.docx"
});
wordsApi.copyStylesFromTemplate(copyRequest)
.then((copyRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of copyRequest: ", copyRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const createRequest = new model.CreateDocumentRequest({
fileName: "Sample.docx"
});
wordsApi.createDocument(createRequest)
.then((createRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of createRequest: ", createRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const createRequest = new model.CreateFolderRequest({
path: "/TestCreateFolder"
});
wordsApi.createFolder(createRequest)
.then((createRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of createRequest: ", createRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestProperty = new model.DocumentPropertyCreateOrUpdate({
value: "John Doe"
})
const createRequest = new model.CreateOrUpdateDocumentPropertyRequest({
name: "Sample.docx",
propertyName: "AsposeAuthor",
property: requestProperty
});
wordsApi.createOrUpdateDocumentProperty(createRequest)
.then((createRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of createRequest: ", createRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const requestProperty = new model.DocumentPropertyCreateOrUpdate({
value: "John Doe"
})
const createRequest = new model.CreateOrUpdateDocumentPropertyOnlineRequest({
document: requestDocument,
propertyName: "AsposeAuthor",
property: requestProperty
});
wordsApi.createOrUpdateDocumentPropertyOnline(createRequest)
.then((createRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of createRequest: ", createRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteAllParagraphTabStopsRequest({
name: "Sample.docx",
index: 0
});
wordsApi.deleteAllParagraphTabStops(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteAllParagraphTabStopsOnlineRequest({
document: requestDocument,
index: 0
});
wordsApi.deleteAllParagraphTabStopsOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteBookmarkRequest({
name: "Sample.docx",
bookmarkName: "aspose"
});
wordsApi.deleteBookmark(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteBookmarkOnlineRequest({
document: requestDocument,
bookmarkName: "aspose"
});
wordsApi.deleteBookmarkOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteBookmarksRequest({
name: "Sample.docx"
});
wordsApi.deleteBookmarks(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteBookmarksOnlineRequest({
document: requestDocument
});
wordsApi.deleteBookmarksOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteBorderRequest({
name: "Sample.docx",
borderType: "left",
nodePath: "tables/1/rows/0/cells/0"
});
wordsApi.deleteBorder(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteBorderOnlineRequest({
document: requestDocument,
borderType: "left",
nodePath: "tables/1/rows/0/cells/0"
});
wordsApi.deleteBorderOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteBordersRequest({
name: "Sample.docx",
nodePath: "tables/1/rows/0/cells/0"
});
wordsApi.deleteBorders(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteBordersOnlineRequest({
document: requestDocument,
nodePath: "tables/1/rows/0/cells/0"
});
wordsApi.deleteBordersOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteCommentRequest({
name: "Sample.docx",
commentIndex: 0
});
wordsApi.deleteComment(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteCommentOnlineRequest({
document: requestDocument,
commentIndex: 0
});
wordsApi.deleteCommentOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteCommentsRequest({
name: "Sample.docx"
});
wordsApi.deleteComments(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteCommentsOnlineRequest({
document: requestDocument
});
wordsApi.deleteCommentsOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteCustomXmlPartRequest({
name: "Sample.docx",
customXmlPartIndex: 0
});
wordsApi.deleteCustomXmlPart(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteCustomXmlPartOnlineRequest({
document: requestDocument,
customXmlPartIndex: 0
});
wordsApi.deleteCustomXmlPartOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteCustomXmlPartsRequest({
name: "Sample.docx"
});
wordsApi.deleteCustomXmlParts(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteCustomXmlPartsOnlineRequest({
document: requestDocument
});
wordsApi.deleteCustomXmlPartsOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteDocumentPropertyRequest({
name: "Sample.docx",
propertyName: "testProp"
});
wordsApi.deleteDocumentProperty(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteDocumentPropertyOnlineRequest({
document: requestDocument,
propertyName: "testProp"
});
wordsApi.deleteDocumentPropertyOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteDrawingObjectRequest({
name: "Sample.docx",
index: 0
});
wordsApi.deleteDrawingObject(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteDrawingObjectOnlineRequest({
document: requestDocument,
index: 0
});
wordsApi.deleteDrawingObjectOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteFieldRequest({
name: "Sample.docx",
index: 0
});
wordsApi.deleteField(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteFieldOnlineRequest({
document: requestDocument,
index: 0,
nodePath: "sections/0/paragraphs/0"
});
wordsApi.deleteFieldOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteFieldsRequest({
name: "Sample.docx"
});
wordsApi.deleteFields(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteFieldsOnlineRequest({
document: requestDocument
});
wordsApi.deleteFieldsOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteFileRequest({
path: "Sample.docx"
});
wordsApi.deleteFile(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteFolderRequest({
path: ""
});
wordsApi.deleteFolder(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteFootnoteRequest({
name: "Sample.docx",
index: 0
});
wordsApi.deleteFootnote(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.doc");
const deleteRequest = new model.DeleteFootnoteOnlineRequest({
document: requestDocument,
index: 0
});
wordsApi.deleteFootnoteOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteFormFieldRequest({
name: "Sample.docx",
index: 0
});
wordsApi.deleteFormField(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteFormFieldOnlineRequest({
document: requestDocument,
index: 0,
nodePath: "sections/0"
});
wordsApi.deleteFormFieldOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteHeaderFooterRequest({
name: "Sample.docx",
sectionPath: "",
index: 0
});
wordsApi.deleteHeaderFooter(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.doc");
const deleteRequest = new model.DeleteHeaderFooterOnlineRequest({
document: requestDocument,
sectionPath: "",
index: 0
});
wordsApi.deleteHeaderFooterOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteHeadersFootersRequest({
name: "Sample.docx",
sectionPath: ""
});
wordsApi.deleteHeadersFooters(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.doc");
const deleteRequest = new model.DeleteHeadersFootersOnlineRequest({
document: requestDocument,
sectionPath: ""
});
wordsApi.deleteHeadersFootersOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteMacrosRequest({
name: "Sample.docx"
});
wordsApi.deleteMacros(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteMacrosOnlineRequest({
document: requestDocument
});
wordsApi.deleteMacrosOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteOfficeMathObjectRequest({
name: "Sample.docx",
index: 0
});
wordsApi.deleteOfficeMathObject(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteOfficeMathObjectOnlineRequest({
document: requestDocument,
index: 0
});
wordsApi.deleteOfficeMathObjectOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteParagraphRequest({
name: "Sample.docx",
index: 0
});
wordsApi.deleteParagraph(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteParagraphListFormatRequest({
name: "Sample.docx",
index: 0
});
wordsApi.deleteParagraphListFormat(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.doc");
const deleteRequest = new model.DeleteParagraphListFormatOnlineRequest({
document: requestDocument,
index: 0
});
wordsApi.deleteParagraphListFormatOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteParagraphOnlineRequest({
document: requestDocument,
index: 0
});
wordsApi.deleteParagraphOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteParagraphTabStopRequest({
name: "Sample.docx",
position: 72.0,
index: 0
});
wordsApi.deleteParagraphTabStop(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteParagraphTabStopOnlineRequest({
document: requestDocument,
position: 72.0,
index: 0
});
wordsApi.deleteParagraphTabStopOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteRunRequest({
name: "Sample.docx",
paragraphPath: "paragraphs/1",
index: 0
});
wordsApi.deleteRun(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.doc");
const deleteRequest = new model.DeleteRunOnlineRequest({
document: requestDocument,
paragraphPath: "paragraphs/1",
index: 0
});
wordsApi.deleteRunOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteSectionRequest({
name: "Sample.docx",
sectionIndex: 0
});
wordsApi.deleteSection(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteSectionOnlineRequest({
document: requestDocument,
sectionIndex: 0
});
wordsApi.deleteSectionOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteStructuredDocumentTagRequest({
name: "Sample.docx",
index: 0,
nodePath: "sections/0/body/paragraphs/0"
});
wordsApi.deleteStructuredDocumentTag(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteStructuredDocumentTagOnlineRequest({
document: requestDocument,
index: 0,
nodePath: "sections/0/body/paragraphs/0"
});
wordsApi.deleteStructuredDocumentTagOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteTableRequest({
name: "Sample.docx",
index: 1
});
wordsApi.deleteTable(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteTableCellRequest({
name: "Sample.docx",
tableRowPath: "sections/0/tables/2/rows/0",
index: 0
});
wordsApi.deleteTableCell(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteTableCellOnlineRequest({
document: requestDocument,
tableRowPath: "sections/0/tables/2/rows/0",
index: 0
});
wordsApi.deleteTableCellOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteTableOnlineRequest({
document: requestDocument,
index: 1
});
wordsApi.deleteTableOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteTableRowRequest({
name: "Sample.docx",
tablePath: "tables/1",
index: 0
});
wordsApi.deleteTableRow(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteTableRowOnlineRequest({
document: requestDocument,
tablePath: "tables/1",
index: 0
});
wordsApi.deleteTableRowOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const deleteRequest = new model.DeleteWatermarkRequest({
name: "Sample.docx"
});
wordsApi.deleteWatermark(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const deleteRequest = new model.DeleteWatermarkOnlineRequest({
document: requestDocument
});
wordsApi.deleteWatermarkOnline(deleteRequest)
.then((deleteRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of deleteRequest: ", deleteRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const downloadRequest = new model.DownloadFileRequest({
path: "Sample.docx"
});
wordsApi.downloadFile(downloadRequest)
.then((downloadRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of downloadRequest: ", downloadRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestOptionsCurrentUser = new model.UserInformation({
name: "SdkTestUser"
})
const requestOptions = new model.FieldOptions({
currentUser: requestOptionsCurrentUser
})
const mailMergeRequest = new model.ExecuteMailMergeRequest({
name: "Sample.docx",
data: fs.readFileSync(BaseTest.localBaseTestDataFolder + "TestMailMergeData.xml", 'utf8'),
options: requestOptions
});
wordsApi.executeMailMerge(mailMergeRequest)
.then((mailMergeRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of mailMergeRequest: ", mailMergeRequestResult);
});
const fs = require("fs");
// creating API instance
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const fileName = "template.doc";
const destName = "Out_PostDocumentExecuteMailMergeWithHTMLData.docx";
const data = fs.readFileSync("TestPostDocumentExecuteMailMerge.txt", "utf8");
// upload source document
const uploadRequest = new UploadFileRequest();
uploadRequest.path = fileName;
uploadRequest.fileContent = fs.createReadStream(fileName);
// Calling API for upload function
wordsApi.uploadFile(uploadRequest)
.then((result) =>
{
// creating request
const request = new ExecuteMailMergeRequest();
request.name = fileName;
request.destFileName = destName;
request.data = data;
// Calling API function
wordsApi.executeMailMerge(request)
.then((result2) =>
{
console.log("Response: " + JSON.stringify(result2));
});
}
const fs = require("fs");
// creating API instance
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const fileName = "SampleMailMergeTemplate.docx";
const destName = "Out_SampleMailMergeTemplate.docx";
const data = fs.readFileSync("SampleMailMergeTemplateData.xml", "utf8");
// upload source document
const uploadRequest = new UploadFileRequest();
uploadRequest.path = fileName;
uploadRequest.fileContent = fs.createReadStream(fileName);
// Calling API for upload function
wordsApi.uploadFile(uploadRequest)
.then((result) =>
{
// creating request
const request = new ExecuteMailMergeRequest();
request.name = fileName;
request.destFileName = destName;
request.data = data;
// Calling API function
wordsApi.executeMailMerge(request)
.then((result2) =>
{
console.log("Response: " + JSON.stringify(result2));
});
}
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestTemplate = fs.createReadStream("Sample.docx");
const requestData = fs.createReadStream(fs.readFileSync(BaseTest.localBaseTestDataFolder + "TestMailMergeData.xml", 'utf8'));
const requestOptionsCurrentUser = new model.UserInformation({
name: "SdkTestUser"
})
const requestOptions = new model.FieldOptions({
currentUser: requestOptionsCurrentUser
})
const mailMergeRequest = new model.ExecuteMailMergeOnlineRequest({
template: requestTemplate,
data: requestData,
options: requestOptions
});
wordsApi.executeMailMergeOnline(mailMergeRequest)
.then((mailMergeRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of mailMergeRequest: ", mailMergeRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestTemplate = fs.createReadStream("TestMailMergeWithImages.doc");
const requestData = fs.createReadStream("MailMergeData.json");
const mailMergeRequest = new model.ExecuteMailMergeOnlineRequest({
template: requestTemplate,
data: requestData,
documentFileName: "Out_TestMailMergeWithImages.doc"
});
wordsApi.executeMailMergeOnline(mailMergeRequest)
.then((mailMergeRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of mailMergeRequest: ", mailMergeRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestTemplate = fs.createReadStream("template.doc");
const requestData = fs.createReadStream("TestPostDocumentExecuteMailMerge.txt");
const mailMergeRequest = new model.ExecuteMailMergeOnlineRequest({
template: requestTemplate,
data: requestData,
documentFileName: "Out_PostDocumentExecuteMailMergeWithHTMLData.docx"
});
wordsApi.executeMailMergeOnline(mailMergeRequest)
.then((mailMergeRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of mailMergeRequest: ", mailMergeRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestTemplate = fs.createReadStream("SampleMailMergeTemplate.docx");
const requestData = fs.createReadStream("SampleMailMergeTemplateData.xml");
const mailMergeRequest = new model.ExecuteMailMergeOnlineRequest({
template: requestTemplate,
data: requestData,
documentFileName: "Out_SampleMailMergeTemplate.docx"
});
wordsApi.executeMailMergeOnline(mailMergeRequest)
.then((mailMergeRequestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of mailMergeRequest: ", mailMergeRequestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const request = new model.GetAvailableFontsRequest({
});
wordsApi.getAvailableFonts(request)
.then((requestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of request: ", requestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const request = new model.GetBookmarkByNameRequest({
name: "Sample.docx",
bookmarkName: "aspose"
});
wordsApi.getBookmarkByName(request)
.then((requestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of request: ", requestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const request = new model.GetBookmarkByNameOnlineRequest({
document: requestDocument,
bookmarkName: "aspose"
});
wordsApi.getBookmarkByNameOnline(request)
.then((requestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of request: ", requestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const request = new model.GetBookmarksRequest({
name: "Sample.docx"
});
wordsApi.getBookmarks(request)
.then((requestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of request: ", requestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const request = new model.GetBookmarksOnlineRequest({
document: requestDocument
});
wordsApi.getBookmarksOnline(request)
.then((requestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of request: ", requestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const request = new model.GetBorderRequest({
name: "Sample.docx",
borderType: "left",
nodePath: "tables/1/rows/0/cells/0"
});
wordsApi.getBorder(request)
.then((requestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of request: ", requestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const requestDocument = fs.createReadStream("Sample.docx");
const request = new model.GetBorderOnlineRequest({
document: requestDocument,
borderType: "left",
nodePath: "tables/1/rows/0/cells/0"
});
wordsApi.getBorderOnline(request)
.then((requestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of request: ", requestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);
const request = new model.GetBordersRequest({
name: "Sample.docx",
nodePath: "tables/1/rows/0/cells/0"
});
wordsApi.getBorders(request)
.then((requestResult) => {
// tslint:disable-next-line:no-console
console.log("Result of request: ", requestResult);
});
import * as fs from "fs";
const clientId = "####-####-####-####-####";
const secret = "##################";
const wordsApi = new WordsApi(clientId, secret);