Author Topic: Help!! How to hide "Insert Page Tab"?  (Read 6761 times)

0 Members and 1 Guest are viewing this topic.

Yangyong

  • Newbie
  • *
  • Posts: 2
Help!! How to hide "Insert Page Tab"?
« on: June 04, 2010, 10:37:08 AM »
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];
            menu.Delete();

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?

Thanks!!!
« Last Edit: June 09, 2010, 03:43:21 PM by Yangyong »

kedas

  • Jr. Member
  • **
  • Posts: 44
Re: Help!! How to hide "Insert Page Tab"?
« Reply #1 on: June 21, 2010, 04:19:07 AM »
Hi,

This will help you
http://www.excelforum.com/excel-programming/695461-vba-to-hide-insert-worksheet-tab.html
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.