pathnames embedded excel files
Posted: Sun Jun 11, 2023 12:02 am
When looking for the filename of an excelfile, containing the data of a chart, via
the code returns "../embeddings/Microsoft_Excel_Worksheet1.xlsx" as pathname.
However, the partname needed to open this file needs to be "/word/embeddings/Microsoft_Excel_Worksheet1.xlsx"
Can I safely replace the 2 dots by "/word" ?
- Code: Select all
List<Relationship> rsp = chart.getRelationshipsPart().getRelationships().getRelationship();
for (Relationship rs : rsp) {
if (rs.getType().equals(Namespaces.EMBEDDED_PKG)) {
excelFilename = rs.getTarget();
break;
}
}
the code returns "../embeddings/Microsoft_Excel_Worksheet1.xlsx" as pathname.
However, the partname needed to open this file needs to be "/word/embeddings/Microsoft_Excel_Worksheet1.xlsx"
Can I safely replace the 2 dots by "/word" ?