Re: get HelpContextID's or Tags of all userforms



Strange response since you asked the question.

The purpose is to show you how to answer the question you asked.

>How did you declare p?

then the answer is as revealed by the code

Dim p as Property

If using late binding, then it would be

Dim p as Object

But that didn't appear to be the case.

--
Regards,
Tom Ogilvy


"RB Smissaert" <bartsmissaert@xxxxxxxxxxxxxxxx> wrote in message
news:OkMDLQp0FHA.728@xxxxxxxxxxxxxxxxxxxxxxx
> OK, but what is the purpose of this Tom?
>
> RBS
>
> "Tom Ogilvy" <twogilvy@xxxxxxx> wrote in message
> news:eLD1PVo0FHA.3780@xxxxxxxxxxxxxxxxxxxxxxx
> > 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: Declarations Procedure and Duplicate Declarations
    ... I commented out the dim statement and the damn thing compiled. ... Sub Want_Info ... Otherwise within the procedure when you make reference to hserow are you ... I am getting a dupe declare compile error on hserow in the following: ...
    (microsoft.public.excel.programming)
  • RE: Declarations Procedure and Duplicate Declarations
    ... You have a nissue with NewC ... dim NewA as whatever ... declare your variable types. ... So your actual sub would look like this ...
    (microsoft.public.excel.programming)
  • RE: a script to tell when a computer was last on the network
    ... Dim strFile, strCurrentUser, strPassword, blnQuiet, intOpMode, i ... '* Purpose: Determines which program is used to run this script. ... '* Sub ShowUsage() ...
    (microsoft.public.windows.server.scripting)
  • Re: Gradient Generator BMP Tool Improved
    ... EndProperty ... It may be used for amy moral purpose. ... Dim mfilesys As Scripting.FileSystemObject ... Private Sub CancelBtn_Click ...
    (comp.lang.basic.visual.misc)
  • Re: Preventing Multiple Instances of a Component
    ... Dim k As New YourClassName.YourClassName ... if you declare it like this: ... I've been trying to get the Assembly Name while in design mode. ... > | argument in the New sub. ...
    (microsoft.public.dotnet.languages.vb)

Loading