making a Macro/journal available in specific modu

to all
I would like to know if there is a way of making a macro/journal available to the user only if he's in the correct Module? for example the toolbar I have created appears to works fine but is always available to the user regardless of the module being used. Anyway of having buttons grey-ed out? the journal I am creating should only be available in the 'advanced simulation' module.

Any suggestion welcome

Thanks

Regards

jxb

Thanks
Regards

Dim theSession As Session = Session.GetSession()
Dim s As UFSession = UFSession.GetUFSession()
Dim workPart As Part = theSession.Parts.Work
Dim NXmodule As Integer = 0
Dim displayPart As Part = theSession.Parts.Display
Dim Titel as string = "Drafting STD"

If theSession.Parts.Work Is Nothing Then
MsgBox("Kein Teil geladen! - No Part Loaded!", MsgBoxStyle.Exclamation,titel)
Exit Sub
End If

s.UF.AskApplicationModule(NXmodule)
If NXmodule <> UFConstants.UF_APP_DRAFTING Then
MsgBox("Drafting function", MsgBoxStyle.Exclamation,titel)
Exit Sub
End If

... workaround, nothing more

Thanks uwe.a. Much appreciated

Thanks
Regards