Multi Tab Userform

I am trying to create a multi tab userform for part, assembly and drawing.

Can someone please help me to add a script to make each tab visible depends on the open document? (other tabs hidden)

For example:

If a part is open in SW, only part tab is visible when this macro run

SolidworksApi macros