public static void Run() { string inputfile = "doc-sample.doc"; string subdirection = "Section"; // Upload input file from local directory to Cloud Storage Common.UploadFile(inputfile, subdirection); // Get a List of Sections from a Word Document WordsSectionsResponse wordsSectionsResponse = Common.WordsService.WordsSections.GetSectionsList(inputfile, Common.FOLDER); Console.WriteLine("\n" + inputfile + " have " + wordsSectionsResponse.Sections.SectionLinkList.Count + " sections."); }
public void Words_Sections_Tests() { try { storageService.File.CopyFile(Utils.CloudStorage_Input_Folder + "/doc-sample.doc", Utils.CloudStorage_Output_Folder + "/doc-sample.doc"); WordsSectionsResponse wordsSectionsResponse = wordsService.WordsSections.GetSectionsList("doc-sample.doc", Utils.CloudStorage_Output_Folder); WordsSectionResponse wordsSectionResponse = wordsService.WordsSections.GetSectionByIndex("doc-sample.doc", 0, Utils.CloudStorage_Output_Folder); PageSetupResponse pageSetupResponse = wordsService.WordsSections.GetPageSetupOfSection("doc-sample.doc", 0, Utils.CloudStorage_Output_Folder); wordsService.WordsSections.UpdatePageSetupOfSection("doc-sample.doc", 0, string.Empty, pageSetupResponse.PageSetup, 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); } }