Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Set UserForm's HelpContextID with Designer

Figured out now how to mass update lots of control HelpContextID's and Tags
with Designer:


Sub UpdateHelpContextIDsAndTags()

'to update all the forms HelpContextID's and Tags
'---------------------------------------------------
Dim VBProj As VBProject
Dim VBComp As VBComponent
Dim ctl As Control
Dim i As Long
Dim LR As Long
Dim arr

Set VBProj = ThisWorkbook.VBProject

LR = Cells(65536, 1).End(xlUp).Row
arr = Range(Cells(2, 1), Cells(LR, 7))

For i = 1 To LR - 1

'set the form to deal with
'-------------------------
If i = 1 Then
Set VBComp = VBProj.VBComponents(arr(i, 1))
Else
If arr(i, 1) < arr(i - 1, 1) Then
Set VBComp = VBProj.VBComponents(arr(i, 1))
End If
End If

With VBComp.Designer
'set the control to deal with
'----------------------------
Set ctl = .Controls(arr(i, 4))

'update the control
'------------------
If Len(arr(i, 6)) 0 Then
ctl.HelpContextID = Val(arr(i, 6))
End If
If Len(arr(i, 7)) 0 Then
ctl.Tag = arr(i, 7)
End If
End With

Next

End Sub


What I couldn't figure out though how to do the same for the HelpContextID's
of the UserForms.
It is less important as there are obviously much less forms than controls,
but I would be interested if
this were possible.


RBS

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find UserForm's caller? PerlDev Excel Discussion (Misc queries) 1 October 24th 06 10:32 PM
load local htm help file with HelpContextID RB Smissaert Excel Programming 1 October 14th 05 01:12 AM
How to control the UserForm's position? OKLover Excel Programming 3 July 7th 05 03:52 PM
RunTime Error 424 in a USERFORM's code JimP Excel Programming 0 November 26th 04 05:27 AM


All times are GMT +1. The time now is 01:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"