none
Word 2013 Actions Pane error RRS feed

  • Question

  • Hi,

    I have a VSTO Word document-level project that was originally written in Visual Studio 2010 that targeted Word 2007. I have converted the project for Visual Studio 2013, targeting Word 2013.  It's a C# app using the 4.51 .NET framework.

    The project has an Action Pane that worked fine in Word 2007, but when I try to open the Action Pane in Word 2013, I get this error:

    "You are currently viewing this document in multiple windows. To attach an XML expansion pack, you must first close all additional windows so that you are viewing the document in only one window."

    I have a checkmark control on my Ribbon that users can click to open/close the Action Pane.

    I don't have any other windows open. I haven't split the document view.

    If I manually switch the view from Print Layout to Draft and then click the checkbox to open the Action Pane, it works fine. So, I tried changing the view to Draft View in my C# code and then opening the Task Pane, but I still get the error. In other words, if I switch the view using the Word UI, it works. But if I switch the view in my code, it doesn't.

    I've seen several reference on this forum of other people getting the error, but that was in Word 2003 and it looks like a service pack fixed the bug.

    Any ideas would be most appreciated.

    Monday, March 24, 2014 10:11 PM

All replies

  • Hello,

    Is the Document Map view turned on when you get the error?

    Please check out the An XML expansion pack cannot be attached to a Word 2003 document or to a Word 2007 document when the Document Map view is turned on article. Is this the case?

    Did you install the latest updates for Office including Service Pack #1?

    Monday, March 24, 2014 11:29 PM
  • Hi Eugene,

    Thanks for the tip, but I don't have the Document Map turned on. And I even set it to off in my application code before trying to view the Action Pane.

    Also, I do have all the latest MS patches and service packs installed.

    I just realized that I didn't specify where in my code I get the exception and maybe that would be helpful to know. I get the error when I execute the last line in this code block, when I add the UserControl (co) to the action pane:

    ContentOutlineActionPane co = new ContentOutlineActionPane();
    co.LoadConentOutline();
    
    co.Anchor = (AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right);
    co.Dock = DockStyle.Top;
    co.AutoScroll = true;
    Globals.ThisDocument.ActionsPane.Controls.Add(co);
    I don't know if this would have anything to do with the issue, but I do have a CustomXMLPart stored in the .docx file. And I also have two content controls that are mapped to elements in the CustomXMLPart.
    • Edited by theLuggage Tuesday, March 25, 2014 2:03 PM
    Tuesday, March 25, 2014 1:54 PM
  •   

    Hi,
    I am trying to reproduce the issue but it failed. I create an Word document customization as code below:

     private void ThisDocument_Startup(object sender, System.EventArgs e)
            {
                UserControl1 myPane = new UserControl1();
                myPane.Anchor = (AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right);
                myPane.Dock = DockStyle.Top;
                myPane.AutoScroll = true;
                this.ActionsPane.Controls.Add(myPane);
            }

    Is this issue fixed after commenting the line below?

    co.LoadConentOutline();

    If yes, would you mind sharing the code with us. If not, would you mind sharing the details to reproduce this issue?

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, March 26, 2014 10:13 AM
    Moderator
  • Hi,

    I did try commenting out the LoadContentOutlin() call, but it didn't help.

    As a test, I created a new, completely empty UserControl and tried opening that. I got the same error.

    My application is fairly complicated, so describing the details is problematic. I would be willing to send the code via private message to someone--preferably a MS employee who will keep the application confidential.

    Wednesday, March 26, 2014 4:04 PM
  • Hi,

    >>As a test, I created a new, completely empty UserControl and tried opening that. I got the same error.<<
    Did you mean create a new project using Visual Studio 2013? Since the issue occurred in a new project with empty UserControl, I suspect this issue is relate to the context.

    Whether this issue will be fixed fater you tried to repare the Office 2013?

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, March 28, 2014 11:11 AM
    Moderator
  • No, I didn't create a new project when I did the test. I just added a new UserControl to my existing document-level project and changed the code to:

    UserControl1 co = new UserControl1();
    
    co.Anchor = (AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right);
    co.Dock = DockStyle.Top;
    co.AutoScroll = true;
    Globals.ThisDocument.ActionsPane.Controls.Add(co);

    Friday, March 28, 2014 1:26 PM
  • Hi,

    I suggest you creating a new document-level project with a simple UserControl to see whether this issue is fixed. If the issue fixed, would you mind share the document to help us to reproduce this issue? You can remove the sensitive information and upload it to OneDrive.

    Best regard

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, April 1, 2014 8:19 AM
    Moderator
  • Hi,

    Thanks for sticking with me. I've uploaded a document to OneDrive. (How do I give you access to it? I've never used OneDrive.)

    Our solution starts with a completely blank Template file. The only thing in the Template file is all the styles used by our solution. The user is presented with a dialog box where they enter various metadata and choose the section headings they want in a document from a pre-selected list.

    The document is then built via code. All section breaks, content controls, boilerplate text, etc., is entered into the document. And a custom ribbon modifies the UI where we remove lots of buttons and add many of our own.

    Some of the content controls are mapped to a CustomXML object that's stored in the .docx file.


    • Edited by theLuggage Tuesday, April 1, 2014 6:28 PM
    Tuesday, April 1, 2014 6:26 PM
  • Hi,

    You can share the file with us by following the link below:
    Share files and folders and change permissions

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, April 2, 2014 7:23 AM
    Moderator
  • Hi,

    I downloaded the document and create a document-level project with the document that downloaded.

    Then I add a usercontrol and add a button on the userconrol. The button works well for me like figure below:

    Would you mind sharing us a demo project? You can keep it as simple as possible, just for us to reproduce the issue.

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, April 3, 2014 12:05 PM
    Moderator
  • Hi,

    I downloaded the document and created a document-level project with the downloaded document.
    Then I add a usercontrol and add a button on the userconrol. The button works well for me like figure below:

    Would you mind sharing us a demo project? You can keep it as simple as possible, just for us to reproduce the issue.

    Best regards

    Fei

     

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, April 3, 2014 12:11 PM
    Moderator