Help!! How to hide "Insert Page Tab"?

Started by Yangyong, June 04, 2010, 03:37:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


I have an automation project which adds pages by code. In Visio 2010, there is a "Insert Page Tab". This causes a lot of trouble for me, since I don't want users to add their own pages.
How can I hide this tab? I know I can hide all the tabs. But that's not what I want. What can I do?

It has been 5 days since I posted my question. No one answered me. I think I may need to say it more clearly. Here it is:

I have a C# WinForms program with an embedded Visio Drawing Control. The program generates a new page when users want to put some part of the diagram in a new page, and the program creates a link symbol in both old page and the new page. When users double-click the link symbol, the page is turned to the other page. They can also click page tabs to go to the other page.

I don't want users to add new pages themselves because in this program, there must be only one start point and one end point.
To prevent users from adding new pages, I disabled "insert pages" context menu by running the following code:

            Visio.MenuSet menuSet = visioUI.MenuSets.get_ItemAtID((int)Visio.VisUIObjSets.visUIObjSetCntx_PageTabs);
            Visio.Menu menu = menuSet.Menus[0];

It works well in previous versions. But in Visio 2010, the smart guys in Microsoft added a new "Insert Page Tab". Till now, I cannot find a way to disable it or hide it.
Yes, I can tell my clients not to touch that tab. But that is quite ugly.
Can anyone tell me what I can do to hide it?




This will help you
Two possible solutions, it won't hide it but it are acceptable solutions.
I will have to do it the same way.

Removing the ribben etc. is another head age for me, I only give them a few custom buttons in 1 toolbar in visio 2003/2007 in a .net application. (no menu)
If anyone has already some code for that I would like to see that, Thanks.