Get tab name of active tab control

X

XP

Using Office 2003 and Windows XP;

I need to return the name on the Tab of the currently activated tab of a Tab
Control. I hope that makes sense; e.g. If I have five tabs and the one that
is currently showing is named "Index" then I need to return "Index".

By chance, has someone got a function that will do this?

Thanks much in advance.
 
S

Stuart McCall

XP said:
Using Office 2003 and Windows XP;

I need to return the name on the Tab of the currently activated tab of a
Tab
Control. I hope that makes sense; e.g. If I have five tabs and the one
that
is currently showing is named "Index" then I need to return "Index".

By chance, has someone got a function that will do this?

Thanks much in advance.

Debug.Print Me.MyTabControl.Pages(Me.MyTabControl.PageIndex).Caption

(Untested. IOW made up on the spot! Ought to work, tho...)
 
M

Marshall Barton

XP said:
Using Office 2003 and Windows XP;

I need to return the name on the Tab of the currently activated tab of a Tab
Control. I hope that makes sense; e.g. If I have five tabs and the one that
is currently showing is named "Index" then I need to return "Index".


This will return what is displayed on the tab:

TabCtl.Pages(TabCtl).Caption

If you have not specified the Caption, then this will return
the Name of the tab page:

TabCtl.Pages(TabCtl).Name
 

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