Hello. I’m attempting to append multiple .docx files together. I followed the example here.
Yet I’m getting the compiler error: “WordsApi does not contain a definition for PostAppendDocument”
I’m stuck and cannot move forward. Please help. Below is the example I followed.
`/*`
` * Working with Document`
` * Append a List of Word Documents`
` *`
` */`
` WordsApi wordsApi = ` `new` `WordsApi(` `"xxxx"` `, ` `"xxx"` `, ` `"http://api.aspose.com/v1.1"` `);`
` StorageApi storageApi = ` `new` `StorageApi(` `"xxxx"` `, ` `"xxx"` `, ` `"http://api.aspose.com/v1.1"` `);`
` ` `//set destination file name`
` String destFileName = ` `"test_doc.docx"` `;`
` ` `//set source file name`
` String sourceFileName = ` `"test_uploadfile.docx"` `;`
` Com.Aspose.Words.Model.DocumentEntryList body = ` `new` `Com.Aspose.Words.Model.DocumentEntryList();`
` List<Com.Aspose.Words.Model.DocumentEntry> docEntries = ` `new` `List<Com.Aspose.Words.Model.DocumentEntry>();`
` Com.Aspose.Words.Model.DocumentEntry docEntry = ` `new` `Com.Aspose.Words.Model.DocumentEntry();`
` docEntry.Href = sourceFileName;`
` docEntry.ImportFormatMode = ` `"KeepSourceFormatting"` `;`
` docEntries.Add(docEntry);`
` body.DocumentEntries = docEntries;`
` ` `try`
` {`
`//upload source file to aspose cloud storage`
`storageApi.PutCreate(sourceFileName, ` `""` `, ` `""` `, System.IO.File.ReadAllBytes(` `"\\temp\\resources\\"` `+ destFileName));`
`//upload destination file to aspose cloud storage`
`storageApi.PutCreate(destFileName, ` `""` `, ` `""` `, System.IO.File.ReadAllBytes(` `"\\temp\\resources\\"` `+ sourceFileName));`
`//invoke Aspose.Words Cloud SDK API to append word document`
`Com.Aspose.Words.Model.DocumentResponse apiResponse = wordsApi.PostAppendDocument(destFileName, ` `null` `, ` `null` `, ` `null` `, body);`
`if` `(apiResponse!=` `null` `&& apiResponse.Status.Equals(` `"OK"` `)){`
` Console.WriteLine(` `"Documents have been appended successfully"` `);`
` ` `//download appended document from storage server`
` Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(destFileName, ` `null` `, ` `null` `);`
` System.Diagnostics.Debug.WriteLine(` `"response:"` `+ storageRes.ResponseStream);`
` System.IO.File.WriteAllBytes(` `"\\temp\\"` `+ sourceFileName, storageRes.ResponseStream);`
`}`
` }`
` ` `catch` `(Exception ex)`
` {`
`System.Diagnostics.Debug.WriteLine(` `"error:"` `+ex.Message+` `"\n"` `+ex.StackTrace);`
` }`