Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Updates to Userform not saved?
I have a Userform with 15 Checkboxes on it, which is in development. Every tiome the User decides to change the bits at the top of the form (the Company logo, the headings etc.), I need to shift the checkboxes up or down so the form looks reasonable.
I decided to knock together a quick VBA process to adjust the position of the Checkboxes (see below). I execute this from a "free standing" Module ('cos it's just for me to use). It works perfectly, except that if I double click on the CBForm, the Checkboxes are still in their original positions (even though the "CBForm.Show" shows them in their "new" positions etc.). Presumably I'm missing a "save" or "update" option at the end of the loop, but I can't find one. Can anyone help? Code:
Sub CBSetPos() Const cintHeight As Integer = 15 Const cintTop As Integer = 50 Dim intPtr As Integer Dim intOldTop As Integer Dim intTop As Integer Dim strCBName As String intTop = cintTop - cintHeight For intPtr = 1 To 15 intTop = intTop + cintHeight strCBName = "Checkbox" & intPtr intOldTop = CBForm.Controls(strCBName).Top CBForm.Controls(strCBName).Top = intTop CBForm.Controls(strCBName).Caption = strCBName & " " & intTop Debug.Print strCBName & ":" & "Was " & intOldTop & " now " & intTop Next intPtr CBForm.Show End Sub |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Updates to Userform not saved?
You may have noticed that this forum is rather slow these days. If you don't
get a reply here, I recommend that you ask in an Office customization/programming forum such as http://social.msdn.microsoft.com/For...orddev/threads (at MSDN) and/or at http://answers.microsoft.com/en-us/o...tomize?tab=all (at the Microsoft Community). -- Stefan Blom Microsoft Word MVP "Sorcerer13" wrote in message ... I have a Userform with 15 Checkboxes on it, which is in development. Every tiome the User decides to change the bits at the top of the form (the Company logo, the headings etc.), I need to shift the checkboxes up or down so the form looks reasonable. I decided to knock together a quick VBA process to adjust the position of the Checkboxes (see below). I execute this from a "free standing" Module ('cos it's just for me to use). It works perfectly, except that if I double click on the CBForm, the Checkboxes are still in their original positions (even though the "CBForm.Show" shows them in their "new" positions etc.). Presumably I'm missing a "save" or "update" option at the end of the loop, but I can't find one. Can anyone help? Code: -------------------- Sub CBSetPos() Const cintHeight As Integer = 15 Const cintTop As Integer = 50 Dim intPtr As Integer Dim intOldTop As Integer Dim intTop As Integer Dim strCBName As String intTop = cintTop - cintHeight For intPtr = 1 To 15 intTop = intTop + cintHeight strCBName = "Checkbox" & intPtr intOldTop = CBForm.Controls(strCBName).Top CBForm.Controls(strCBName).Top = intTop CBForm.Controls(strCBName).Caption = strCBName & " " & intTop Debug.Print strCBName & ":" & "Was " & intOldTop & " now " & intTop Next intPtr CBForm.Show End Sub -------------------- -- Sorcerer13 |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
UserForm Macro | Microsoft Word Help | |||
userform question | Microsoft Word Help | |||
Userform | Microsoft Word Help | |||
Userform in word | Microsoft Word Help | |||
Userform - .Range_ | Microsoft Word Help |