Hello Timo,
Thanks for using Microsoft Newsgroup Support Service, my name is Ji Zhou
[MSFT] and I will be working on this issue with you.
Based on my understanding, the demand is creating a customized message bar
as the system built-in one, Macro Security Warning Bar which appears above
the Word document view, and below the ribbon. If I have misunderstood,
please feel free to correct me.
Based on my experience, Office Object Model does not expose anything for
the developers to create a customized message bar exactly as that. But
Office 2007 Object Model does provide an interface named
ICustomTaskPaneConsumer through which we can create a docked panel. Thus,
may I suggest we create the custom task pane as a workaround instead? To
make it look more like the message bar, we can set the custom task pane's
DockPosition to be msoCTPDockPositionTop and its DockPositionRestrict to be
msoCTPDockPositionRestrictNoChange. So it will appear between the document
view and the ribbon and cannot be dragged to other placed by the end user.
The main difference is that the custom task pane can be resized by the
user, and it has a mini title bar that cannot be removed.
The following codes work fine on my side. Would you like to have a try and
let me know if this can fit your demand?
public class Connect : Object, Extensibility.IDTExtensibility2,
Office.ICustomTaskPaneConsumer
{
public void CTPFactoryAvailable(Microsoft.Office.Core.ICTPFactory
CTPFactoryInst)
{
Office.CustomTaskPane ctp =
CTPFactoryInst.CreateCTP("WordSharedAddIn.MessageBar", "My Message Bar",
Type.Missing);
ctp.Visible = true;
ctp.DockPosition =
Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionTop;
ctp.DockPositionRestrict =
Microsoft.Office.Core.MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictN
oChange;
}
}
And you can get more detailed information about creating a custom task pane
in this MSDN link,
http://msdn.microsoft.com/en-us/library/aa338197.aspx.
If you have any future questions or concerns on this, please do not
hesitate to let me know and I will try my best to provide assistance.
Have a nice day!
Best regards,
Ji Zhou (
[email protected], remove 'online.')
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.