How to hide ribbon in word 2007 programmaticlly in C++?

K

Kaven

Does anybody know how to hide ribbon or menu bar in word 2007 using C++?(or
VBA).

I have a requirement that when using CHtmlView in MFC to open office
document, the ribbon or menu,toolbar must be hide to increase the viewing
area. for word 2003, the following code works well:

Dim iCounter As Integer
For iCounter = 1 To CommandBars.Count
Application.CommandBars(iCounter).Enabled = False
Next

But in word 2007,it don't work. Should notice that when drag and drop a word
document into IE for opening, there is no ribbon. But why I use CHtmlView or
IWebBrower2 to navigate a word document, the ribbon area exist?

Thank you for your help.
 
P

Perry

Here are some articles that might be of help to you.
http://blogs.msdn.com/mshneer/archive/2006/05/31/doclevelribbons.aspx
and
http://groups.google.nl/group/micro...t&q=getcustomui&rnum=2&hl=nl#6443a119f150cba7


To customise the ribbon in VBA, you would need to use the
(Office.)IRibbonExtensibility() and GetCustomUI() functions
Functions *were* available in the VBE object browser but didn't show up with
intellisense.
I'm using Office (beta) 12.0.4017.1004 and maybe these functions weren't
part of the Office library of this version.

BTW, for C++ the abovementioned functions will also be available in the
Office interop wrappers.

The development community is now searching for ways to customise the ribbon,
without needing extensive XML coding.
I've seen a demo of MS showing how to customise the ribbon using XML but
that's not what I'm after;
I'm not an XML developer .... :)

Hopefully someone will be able to respond to your request, and I will be
monitoring this thread ... :)

Krgrds,
Perry
 
P

Patrick Schmid [MVP]

I don't know of any way to actually hide the Ribbon. There might be a
way to do it in the OP's environment, but that might depend on those
components.
RibbonX is the only way to customize the Ribbon. There simply is no way
around it and anything the development community will come up with will
be ultimately based on RibbonX.

See http://pschmid.net/office2007/ribbonx/reference/index.php for a link
to a better C++ RibbonX tutorial.

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed
 
P

Perry

There's a document available in yr Visual Studio 2005 folder:
How to use VSTO 2005 SE Beta

There are pointers as to how to customise the Ribbon.

I just finished installing both VS 2005 Pro and VSTO for Office 2007 (beta)
on Vista Ult.
So I can't tell whether this document is available if you install VS 2005
seperately or whether you need to
install VSTO for Office 2007 addtly to get access to this document.

Krgrds,
Perry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top