Hi Warren,
I am still having the problem: I feel you had just fixed my example, but actual, my real link is more complicated, one of them can be like this:
aura://82c29c22-67ea-45db-b7df-aad2f1ad2ad5/5f0fa673-9400-46fa-bc6b-ea0d2351ba69_0/65956757-2119-470e-892a-a9dd92285790/13/4/0/
and, I need to replace it with different value, such as, all the values are dynamically change based on doc:
aura://091A0986-231E-4405-BC75-24D4BBD08DF8/5E49E556-5BCD-4EF5-A9BF-7C35A6AD46E2_0/853B6FC8-1A79-482F-A22D-31E01A525429/13/4/0/
My code is like this:
string docFile = @"c:\temp\book1.xls"; //which has one my custom link..
System.IO.FileStream fstream = new System.IO.FileStream(docFile, FileMode.Open);
Workbook workbook = new Workbook();
workbook.Open(fstream);
fstream.Close();
foreach (Worksheet worksheet in workbook.Worksheets) {
foreach (Aspose.Cells.Hyperlink link in worksheet.Hyperlinks){
string newUrl = FixLink(link.Address); //my function to replace existing link with new address
link.Address = newUrl;
//link.TextToDisplay = newUrl;
//link.ScreenTip = newUrl;
}
}
workbook.Save(docFile, FileFormatType.Default);
workbook = null;
I tried with WorkBook.Open(docFile) method, still doesn't work ...
I only want to change the address, not any other properties of the link. Can you have a generic solution to fix, or for first step, see if you can fix with address format on the top, (aura://..../....)?
Thanks
Chang