ワークシートのハイパーリンクを編集
Contents
[
Hide
]
Aspose.Cellsを使用すると、Worksheet.Hyperlinksコレクションを使用してワークシートのすべてのハイパーリンクにアクセスできます。このコレクションから1つずつハイパーリンクにアクセスしてそのプロパティを編集することができます。
以下のサンプルコードでは、ワークシートのすべてのハイパーリンクにアクセスし、そのHyperlink.AddressプロパティをAsposeウェブサイトに変更します。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
Workbook workbook = new Workbook(dataDir + "Sample.xlsx"); | |
Worksheet worksheet = workbook.Worksheets[0]; | |
for (int i = 0; i < worksheet.Hyperlinks.Count; i++) | |
{ | |
Hyperlink hl = worksheet.Hyperlinks[i]; | |
hl.Address = "http://www.aspose.com"; | |
} | |
workbook.Save(dataDir + "output_out.xlsx"); |