I'm still not much experienced with C#, and I'm having trouble reading a docx file. It contains a music file embedded and I don't know how to open the .docx file and play that music. I want to play this track. I don't have other options because there are like 360 similar files like this which I need to process I've tried to search but couldn't find anything. Here is the picture
EDIT: I've managed to find the audio file here, its an oleobject type. Now how do I save this to my disk?
public class docParser
{
public static void openDocx(string filepath)
{
String docText = readDocx(@filepath);
Console.WriteLine(docText);
}
public static string readDocx(string filepath)
{
using (WordprocessingDocument wordDocument = WordprocessingDocument.Open(filepath, false))
{
OpenXmlPart oleobject;
oleobject = wordDocument.MainDocumentPart.GetPartById("docRId2"); //I need to save this
}
}
}
And while using it, I write
public Form1()
{
docParser.openDocx("d:\\sample.docx");
}