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

Nov 3, 2014 at 3:52 PM
Hi,

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?
Thanks!
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;
try
{
    _wordApplication.Caption = guid;
    wordHwnd = FindWindow("OpusApp", _wordApplication.ActiveDocument.Name + " - " + guid);
}
finally
{
    _wordApplication.Caption = wordApplicationCaption;
}

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

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