none class RRS feed

  • Question


    hello everyone,


                           I have installed the openxmlsdk and added reference to my word add-in project but i couldnt get the package class in my project. i need to implement this



    using (Package package = Package.Open("mydocument.docx"))






    string relID= rId1;

    PackageRelationship imagerelationship = mainPart.GetRelationship(relID);


    in my project


    namespace wordplugin


    public partial class ThisAddIn


    const string wordmlNamespace = "";

    const string relationshipNamespace = "";

    private void ThisAddIn_Startup(object sender, System.EventArgs e)


    this.Application.DocumentOpen += new Microsoft.Office.Interop.Word.ApplicationEvents4_DocumentOpenEventHandler(Application_DocumentOpen);


    void Application_DocumentOpen(Microsoft.Office.Interop.Word.Document Doc)


           // implement the package class to retrieve the a .xml file using the relationship id "context" and retreive the

          cx : docid and cx : scope in a message box here. so that the a file is opened using the word it checks for the context.xml file with the realtionship id and display the content in message box.



    my relationship id is


    <?xml version="1.0" encoding="UTF-8" standalone="no" ?>

    - <Relationships xmlns="">
       <Relationship Id="context" Target="docProps/context.xml" Type="" />
    my .xml file content is
    <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
    - <cx:context xmlns:cx="" cx: docid="860a4b2e-81c0-4320-970a-f927bc053c0b">
      <cx: scope cx:initdata="1192198631222" cx:lastvisit="1192198631222" cx:url="" />
    or is there any other way to do this.
    Thank you.
    Thursday, March 20, 2008 12:17 PM