Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Commit

Permalink
- fixed get hyperlinks in excel
Browse files Browse the repository at this point in the history
  • Loading branch information
desjarlais committed Feb 18, 2021
1 parent 6129f76 commit 50abed5
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 6 deletions.
30 changes: 30 additions & 0 deletions WinForms/FrmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ public void DisableButtons()
BtnListExcelHyperlinks.Enabled = false;
BtnDeleteUnusedStyles.Enabled = false;
BtnDeleteEmbeddedLinks.Enabled = false;
BtnListExcelHyperlinks.Enabled = false;
}

public enum OxmlFileFormat { Xlsx, Xlsm, Xlst, Dotx, Docx, Docm, Potx, Pptx, Pptm, Invalid };
Expand Down Expand Up @@ -310,6 +311,7 @@ public void SetUpButtons()
BtnListConnections.Enabled = true;
BtnConvertToNonStrictFormat.Enabled = true;
BtnDeleteEmbeddedLinks.Enabled = true;
BtnListExcelHyperlinks.Enabled = true;

if (ffmt == OxmlFileFormat.Xlsm)
{
Expand Down Expand Up @@ -5050,7 +5052,35 @@ private void BtnListExcelHyperlinks_Click(object sender, EventArgs e)
{
using (SpreadsheetDocument excelDoc = SpreadsheetDocument.Open(TxtFileName.Text, false))
{
int count = 0;

foreach (WorksheetPart wsp in excelDoc.WorkbookPart.WorksheetParts)
{
IEnumerable<O.Spreadsheet.Hyperlink> hLinks = wsp.Worksheet.Descendants<O.Spreadsheet.Hyperlink>();
foreach (O.Spreadsheet.Hyperlink h in hLinks)
{
count++;

string hRelUri = null;

// then check for hyperlinks relationships
if (wsp.HyperlinkRelationships.Count() > 0)
{
foreach (HyperlinkRelationship hRel in wsp.HyperlinkRelationships)
{
if (h.Id == hRel.Id)
{
hRelUri = hRel.Uri.ToString();
LstDisplay.Items.Add(count + StringResources.wPeriod + h.InnerText + " Uri = " + hRelUri);
}
}
}
else
{
LogInformation(LogType.EmptyCount, "hyperlinks", string.Empty);
}
}
}
}
}
catch (Exception ex)
Expand Down
2 changes: 1 addition & 1 deletion bin/Debug/Office File Explorer.application
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>5T4I6gceS0av43Q/zyCBh3GS+ts4M60fbMTg3wuvSXA=</dsig:DigestValue>
<dsig:DigestValue>LTgOozYHdAhmC9UgGJdXCQj6Vd2e+dLa5ft6K2N4Aj8=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified bin/Debug/Office File Explorer.exe
Binary file not shown.
4 changes: 2 additions & 2 deletions bin/Debug/Office File Explorer.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Office File Explorer.exe" size="4488192">
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Office File Explorer.exe" size="4488704">
<assemblyIdentity name="Office File Explorer" version="1.0.2.50" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>Lp7vWYCPBfqGp/AitgwcniWXTihAjiDySCLECOINd7w=</dsig:DigestValue>
<dsig:DigestValue>EJR/AvBYx4uImKsS4Qxy20Ae8u8lTcCrEnCKDAuDNag=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified bin/Debug/Office File Explorer.pdb
Binary file not shown.
Binary file modified bin/Debug/app.publish/Office File Explorer.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion obj/Debug/Office File Explorer.application
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>5T4I6gceS0av43Q/zyCBh3GS+ts4M60fbMTg3wuvSXA=</dsig:DigestValue>
<dsig:DigestValue>LTgOozYHdAhmC9UgGJdXCQj6Vd2e+dLa5ft6K2N4Aj8=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified obj/Debug/Office File Explorer.exe
Binary file not shown.
4 changes: 2 additions & 2 deletions obj/Debug/Office File Explorer.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Office File Explorer.exe" size="4488192">
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Office File Explorer.exe" size="4488704">
<assemblyIdentity name="Office File Explorer" version="1.0.2.50" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>Lp7vWYCPBfqGp/AitgwcniWXTihAjiDySCLECOINd7w=</dsig:DigestValue>
<dsig:DigestValue>EJR/AvBYx4uImKsS4Qxy20Ae8u8lTcCrEnCKDAuDNag=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified obj/Debug/Office File Explorer.pdb
Binary file not shown.

0 comments on commit 50abed5

Please sign in to comment.