aravind

aravind

  • NA
  • 20
  • 73.2k

retrieve embedded object xls from word document in c# in open xml

Feb 9 2010 2:15 AM


Hai Friends::
       I want Retrive a embedded object xls file name from word document in c#.net. when i using openxml Sdk2.0  i can get the Worksheet name .I want  get .Xls Filename. Any one Give Suggestion.
 
ArrayList arlFileList= new ArrayList();
Package toExtract = Package.Open(@"C:\Test Doc.docx");
foreach (PackagePart pPart in toExtract.GetParts())
{

partURI =
Path.GetFileName(pPart.Uri.ToString());


if (partURI.ToLower().EndsWith(".xlsx") || partURI.ToLower().EndsWith(".xls"))
{
string xlsFile = partURI.ToString();
}
}