none
MS Word 2010 - Custom properties panel RRS feed

  • Question

  • Hello everyone,

    I'm new to development in general (I'm supposed to be a technical writer) and to developping for Word in particular.

    Here's my issue: I'm supposed to developp an add-in for Word for my company that would allow the properties panel to pop up on start (that I managed to do) BUT that would show different property fields than what is already available.

    I tried to look up here and there on both MSDN and Google, but couldn't find any answer that would suit my needs.

    Does anyone have an idea? What am I supposed to do ?

    P.S.: I don't have InfoPath.

    Thanks!

    Monday, October 24, 2016 2:41 PM

Answers

  • Hi,

    We could show the properties what we need when the add-in loaded by using DocumentProperties Object (Office).

    For example, show the property in the messagebox, or put all the properties in a winform and showing in DocumentOpen event. We could not show in the ThisAddIn_Startup event because the document is Null, the add-in is loaded when application starts instead of opening/creating documents.         

    private void ThisAddIn_Startup(object sender, System.EventArgs e)
            {
                this.Application.DocumentOpen += Application_DocumentOpen1;
            }
    
            private void Application_DocumentOpen1(Word.Document Doc)
            {
                Office.DocumentProperty pro = Doc.BuiltInDocumentProperties["Author"];
                System.Windows.Forms.MessageBox.Show(pro.Value);
                Form1 f1 = new Form1();
                f1.Show();
            }


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Chenchen LiModerator Thursday, October 27, 2016 3:04 AM
    • Marked as answer by TaggyM Thursday, October 27, 2016 11:58 AM
    Thursday, October 27, 2016 3:03 AM
    Moderator

All replies

  • Hi,

    What is the properties panel you refer to?  What are the properties you want to put on that?

    If you want something to show up when the add-in loaded, you could put the code into ThisAddIn_Startup event, like:

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

            {

                System.Windows.Forms.MessageBox.Show("Hello");

            }

    Tuesday, October 25, 2016 5:38 AM
    Moderator
  • Hello!

    So I'm refering to the Document Panel actually. By default, it is set up to display the standard properties, and I was wondering if there was a way to make it display some advanced properties as well (like the date, the issue number...).

    The fields' values impact headers and footers in my society, and they're looking for a way to automate this a bit, or at least make it faster and easier for the editors.

    Thank you for your input anyway, it gives me some new perspective on how to solve this.

    Tuesday, October 25, 2016 9:36 AM
  • Just make your own user form that displays what you want from the Document Panel and your additional requirements.

    AFAIK, you're not going to be able to change the default panel.


    Kind Regards, Rich ... http://greatcirclelearning.com

    Wednesday, October 26, 2016 10:07 PM
  • Hi,

    We could show the properties what we need when the add-in loaded by using DocumentProperties Object (Office).

    For example, show the property in the messagebox, or put all the properties in a winform and showing in DocumentOpen event. We could not show in the ThisAddIn_Startup event because the document is Null, the add-in is loaded when application starts instead of opening/creating documents.         

    private void ThisAddIn_Startup(object sender, System.EventArgs e)
            {
                this.Application.DocumentOpen += Application_DocumentOpen1;
            }
    
            private void Application_DocumentOpen1(Word.Document Doc)
            {
                Office.DocumentProperty pro = Doc.BuiltInDocumentProperties["Author"];
                System.Windows.Forms.MessageBox.Show(pro.Value);
                Form1 f1 = new Form1();
                f1.Show();
            }


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Chenchen LiModerator Thursday, October 27, 2016 3:04 AM
    • Marked as answer by TaggyM Thursday, October 27, 2016 11:58 AM
    Thursday, October 27, 2016 3:03 AM
    Moderator
  • Hi, this works perfectly!

    Thank you very much!

    Thursday, October 27, 2016 11:59 AM