public static void Run() { string inputfile = "doc-sample.doc"; // Upload input file from local directory to Cloud Storage Common.UploadFile(inputfile, string.Empty); // Replace Text in a Word Document WordsReplaceText replaceText = new WordsReplaceText("Aspose", "Aspose Pty Ltd", true, false); Common.WordsService.WordsTextItems.ReplaceDocumentText(inputfile, Common.GetOutputFilePath(inputfile, true), replaceText, Common.FOLDER); Console.WriteLine("\nText replaced successfully"); }
public void Words_TextItems_Tests() { try { storageService.File.CopyFile(Utils.CloudStorage_Input_Folder + "/doc-sample.doc", Utils.CloudStorage_Output_Folder + "/doc-sample.doc"); WordsTextItemsResponse wordsTextItemsResponse = wordsService.WordsTextItems.ReadDocumentTextItems("doc-sample.doc", Utils.CloudStorage_Output_Folder); WordsReplaceText replaceText = new WordsReplaceText("Aspose", "Aspose Pty Ltd", true, false); wordsService.WordsTextItems.ReplaceDocumentText("doc-sample.doc", string.Empty, replaceText, Utils.CloudStorage_Output_Folder); //storageService.File.DownloadFile(Utils.CloudStorage_Output_Folder + "/doc-sample.doc", Utils.Local_Output_Path + "/doc-sample.doc"); } catch (Exception ex) { Assert.Fail(ex.Message); } }