public void Cells_Hypelinks_Tests()
        {
            try
            {
                storageService.File.CopyFile(Utils.CloudStorage_Input_Folder + "/cells-sample.xlsx", Utils.CloudStorage_Output_Folder + "/cells-sample.xlsx");

                HyperlinksResponse     hyperlinksResponse     = cellsService.Hypelinks.GetWorksheetHyperlinks(name, "sheet1", Utils.CloudStorage_Output_Folder);
                CellsHyperlinkResponse cellsHyperlinkResponse = cellsService.Hypelinks.GetWorksheetHyperlinkByIndex(name, "sheet1", 0, Utils.CloudStorage_Output_Folder);

                CellsHyperlinkResponse cellsHyperlinkResponse2 = cellsService.Hypelinks.AddWorksheetHyperlink(name, "sheet1", 0, 0, 5, 5, "http://www.aspose.com", Utils.CloudStorage_Output_Folder);

                cellsHyperlinkResponse2.Hyperlink.TextToDisplay = "Aspose";

                CellsHyperlinkResponse cellsHyperlinkResponse3 = cellsService.Hypelinks.UpdateWorksheetHyperlinkByIndex(name, "sheet1", 0, cellsHyperlinkResponse2.Hyperlink, Utils.CloudStorage_Output_Folder);

                cellsService.Hypelinks.DeleteWorksheetHyperlinkByIndex(name, "sheet1", 0, Utils.CloudStorage_Output_Folder);
                cellsService.Hypelinks.DeleteAllHyperlinksInWorksheet(name, "sheet1", Utils.CloudStorage_Output_Folder);

                //storageService.File.DownloadFile(Utils.CloudStorage_Output_Folder + "/cells-sample.xlsx", Utils.Local_Output_Path + "/cells-sample.xlsx");
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }
Example #2
0
        public static void Run()
        {
            // ExStart:1
            WordsApi   wordsApi   = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName = "SampleWordDocument.docx";
            String storage  = null;
            String folder   = null;

            try
            {
                // Upload the file
                storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
                // Invoke Aspose.Words Cloud SDK API to read all hyperlinks from document
                HyperlinksResponse apiResponse = wordsApi.GetDocumentHyperlinks(fileName, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    foreach (Com.Aspose.Words.Model.Hyperlink hyperlink in apiResponse.Hyperlinks.HyperlinkList)
                    {
                        Console.WriteLine("Text: " + hyperlink.DisplayText + " Value: " + hyperlink.link + " link: " + hyperlink.link.Href);
                    }
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }