![]() |
|
|||||||
|
|
|
Thread Tools | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Marc
I'm not sure what you mean by 'save those values to the userform'. Just by moving the control on the userform when editing the layout you are effectively saving those values. You can use the GUI to reposition any control on the userform (assuming you can select it). You can also use a macro such as the following to position the form itself or move a control to a particular position on the form. Because of its name, this macro will autorun when the form is loading so the form will open showing your control in its rightful position. Code:
Private Sub UserForm_Initialize()
With Me
.StartUpPosition = 0
.Left = Application.Left + 0.5 * (Application.Width - .Width)
.Top = Application.Top + 0.5 * (Application.Height - .Height)
.txHyperlinkzName.Top = 134
.txHyperlinkzName.Left = 24
.txHyperlinkzName.BackColor = &HC000&
End With
End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
#2
|
|||
|
|||
|
Quote:
In other words, after I ran the Initialize sub and subsequently closed the userform (after showing it), "txHypterlinkzName" would return to a location off the screen, which made it hard to continue editing the userform. Graham's instructions enabled me to get to txHypterlinkzName's Properties Window (encircled in green in the attached image file, to the left). Once I got access to txHypterlinkzName's Properties Window, I was able to manually insert the settings that are encircled in red, below to the left, inside the green box. After I inserted those settings, I executed a Windows/Word [File, Save] on the form. Now, when I am editing the userform, "txHypterlinkzName" continues to be situated at the location encircled in blue below. It would be nice to know how to use vba to perform the equivalent of me manually inserting the settings in the properties window, and thereafter clicking, File, Save. You showed me how to get and set the controls' coordinates programmatically, which was very helpful to me. But assume that I have a large userform with many controls that need to be renamed (instead of having their coordinates changed) programmatically (which is a problem I remember having more than once), it would be nice to know how to save the changes to the form, so that the changes are embedded in the form when I resume editing the form. Much thanks, again, Marc |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Find and replace query re missing spaces
|
Johanna | Word | 3 | 11-22-2019 01:06 AM |
Macro to Find and Replace Does Not Work - But Works Manually
|
Rod_Bowyer | Excel Programming | 7 | 10-14-2018 11:49 PM |
Find and Replace doesn't work.
|
Bop70 | Word | 3 | 02-04-2015 11:45 AM |
| Userform is invisible in Project box for old templates | billy8b8 | Word VBA | 4 | 07-19-2014 03:44 PM |
| Find and replace No longer work | TJH | Word | 3 | 03-25-2014 11:33 PM |