Re: get HelpContextID's or Tags of all userforms

Tech-Archive recommends: Speed Up your PC by fixing your registry



Here is a little trick:

Sub abc()
Dim oVBComp As VBComponent
Dim p As Object
For Each oVBComp In ThisWorkbook.VBProject.VBComponents
If oVBComp.Type = 3 Then
For Each p In oVBComp.Properties
Debug.Print TypeName(p)
Exit Sub
Next
End If
Next
End Sub


Displays

Property

--
Regards,
Tom Ogilvy


"RB Smissaert" <bartsmissaert@xxxxxxxxxxxxxxxx> wrote in message
news:OvlJsBo0FHA.3020@xxxxxxxxxxxxxxxxxxxxxxx
> Peter,
>
> How did you declare p?
>
> RBS
>
> "Peter T" <peter_t@discussions> wrote in message
> news:OEljXjm0FHA.3756@xxxxxxxxxxxxxxxxxxxxxxx
> > Hi Bart,
> >
> > Try inserting the following after your "If oVBComp.Type = 3 Then"
> >
> > For Each p In oVBComp.Properties
> > 'Debug.Print p.Name
> > If p.Name = "Tag" Then
> > MsgBox p.Value, , oVBComp.Name
> > End If
> > If p.Name = "HelpContextID" Then
> > MsgBox p.Value, , oVBComp.Name
> > End If
> > Next
> >
> > Of course if you could get same from the userform object though that
means
> > loading it.
> >
> > Regards,
> > Peter T
> >
> > "RB Smissaert" <bartsmissaert@xxxxxxxxxxxxxxxx> wrote in message
> > news:#W$7zxl0FHA.2752@xxxxxxxxxxxxxxxxxxxxxxx
> >> Is there a way to get all the HelpContextID's or Tags of all the
> >> userforms
> >> in a project?
> >> I can get all the names of all the forms, but sofar no success to get
the
> >> HelpContextID's or Tags.
> >>
> >> Sub test()
> >>
> >> Dim oVBProj As VBProject
> >> Dim oVBComp As VBComponent
> >>
> >> Set oVBProj = ThisWorkbook.VBProject
> >>
> >> On Error Resume Next
> >>
> >> For Each oVBComp In oVBProj.VBComponents
> >> If oVBComp.Type = 3 Then
> >> MsgBox oVBComp.Name
> >> End If
> >> Next
> >>
> >> End Sub
> >>
> >> Thanks for any advice.
> >>
> >>
> >> RBS
> >>
> >
> >
>


.



Relevant Pages

  • Re: Modules not being deleted
    ... Sub DelModsOnTime() ... Dim vbComps As Object ' VBComponents ... Dim vbComp As Object ' VBComponent ...
    (microsoft.public.excel.programming)
  • Re: navigation, zooming in/out, how to solve it?
    ... Animated zooming would be fairly easy to accomplish. ... But in general, zooming is done by scaling groups or tags, which depends ... Text will not scale well, you will need to adjust fonts. ... use a sub to do it ...
    (comp.lang.perl.tk)
  • Re: Modules not being deleted
    ... Thanks Peter I'll try this. ... Sub DelModsOnTime() ... Dim vbComps As Object ' VBComponents ... Dim vbComp As Object ' VBComponent ...
    (microsoft.public.excel.programming)
  • Re: Modules not being deleted
    ... work - have they got "Trust access to VBP" ticked in macro Security, ... Sub DelModsOnTime() ... Dim vbComps As Object ' VBComponents ... Dim vbComp As Object ' VBComponent ...
    (microsoft.public.excel.programming)
  • Re: Macro for commenting out columns in table
    ... This code will work for most tags. ... > Private Sub SurroundText ... Just Google for "FrontPage macro". ...
    (microsoft.public.frontpage.programming)