This project has moved. For the latest updates, please go here.

How to create a TaskPanel like control (Action Pane?) in Office 2003

Nov 3, 2014 at 3:52 PM

I successfully created an TaskPane with an control UI to insert text into a Word document. The TaskPane is activated from a Ribbon Button in Office 2007-2013.

Now I'm trying to show an control UI on Office 2003 activated from an CommandBar button. I managed to create the button and invoke the click event, but, I don't know how to show the control UI like in TaskPane.

This can be done?
Nov 6, 2014 at 2:35 PM
Edited Nov 6, 2014 at 2:36 PM
I solve my problem by creating and displaying a form as UI. It is unable to be attached to the Word interface as the panels, but it works.

Here is the code:
string guid = Guid.NewGuid().ToString();

string wordApplicationCaption = _wordApplication.Caption;

int wordHwnd = 0;
    _wordApplication.Caption = guid;
    wordHwnd = FindWindow("OpusApp", _wordApplication.ActiveDocument.Name + " - " + guid);
    _wordApplication.Caption = wordApplicationCaption;

NativeWindow wordWindow = new NativeWindow();
wordWindow.AssignHandle(new IntPtr(wordHwnd));

_olderOfficePanelForm = new OlderOfficePaneForm();
_olderOfficePanelForm.Text = _panelTitle;
Marked as answer by jonatastrafaniuc on 11/6/2014 at 7:37 AM