H
Heather Mills
I would like to learn how to use simple user forms for a front end to
some macros I have written. I would really appreciate having a simple
user form to look at as a template. Would someone be willing to create
one?
Here's a simple form that would be very helpful to me as a template:
This form would be used to set some of the page parameters to position
a text area on a larger page. For example, I might want to position a
text area for a 4x6 card on a letter-size (8.5 x 11) page. It could be
positioned in the upper right corner, centered at the bottom, etc.
The form would have 5 input fields: form height (inches), form width
(inches), horizontal alignment (left, center, right), vertical
alignment (top, center, bottom), and minimum margin (inches). The
minimum margin would default to 0.5. The others would start out blank.
The alignment controls would be radio buttons.
The form would have 2 read-only data fields: page width (usually 8.5)
and page height (usually 11). These would be based on the document
settings.
The form would have 4 output fields (calculated): the 4 margins (left,
right, top, bottom).
The form would have 3 controls (buttons): Calculate (calculate the
margins and display the results), Reset (reset the form to the intiial
values), Cancel (exit without changing any document settings), and Set
Margins (change the document margins to the calculated values).
The form itself would look something like this:
Paper Height (11.0) Paper Width (8.5)
Form Height ________ Align o Top o Center o Bottom
Form Width ________ Align o Left o Center o Right
Minimum Margin ___0.5___
Margins Top ..... Bottom ..... Left ..... Right .....
[Calculate] [Reset] [Cancel] [Set Margins]
The values in () indicate read-only fields.
The ________ fields indicate input fields without default values.
The ___0.5___ indicates an input field with a defrault value.
The [] fields indicate control buttons.
The form also needs a place for an error message such as if the user
enters a form width of 20 or a minimum margin that is too large.
I've read the documentation and several tutorials. I think I have a
general idea how to do this, but there are good ways to write code and
poor ways. I'd like to see one simple user form done with good coding
methods.
Thanks a bunch
PS: I'm posting this here, because there is almost no activity on
microsoft.public.word.vba.userforms. If this is the wrong place,
please advise.
some macros I have written. I would really appreciate having a simple
user form to look at as a template. Would someone be willing to create
one?
Here's a simple form that would be very helpful to me as a template:
This form would be used to set some of the page parameters to position
a text area on a larger page. For example, I might want to position a
text area for a 4x6 card on a letter-size (8.5 x 11) page. It could be
positioned in the upper right corner, centered at the bottom, etc.
The form would have 5 input fields: form height (inches), form width
(inches), horizontal alignment (left, center, right), vertical
alignment (top, center, bottom), and minimum margin (inches). The
minimum margin would default to 0.5. The others would start out blank.
The alignment controls would be radio buttons.
The form would have 2 read-only data fields: page width (usually 8.5)
and page height (usually 11). These would be based on the document
settings.
The form would have 4 output fields (calculated): the 4 margins (left,
right, top, bottom).
The form would have 3 controls (buttons): Calculate (calculate the
margins and display the results), Reset (reset the form to the intiial
values), Cancel (exit without changing any document settings), and Set
Margins (change the document margins to the calculated values).
The form itself would look something like this:
Paper Height (11.0) Paper Width (8.5)
Form Height ________ Align o Top o Center o Bottom
Form Width ________ Align o Left o Center o Right
Minimum Margin ___0.5___
Margins Top ..... Bottom ..... Left ..... Right .....
[Calculate] [Reset] [Cancel] [Set Margins]
The values in () indicate read-only fields.
The ________ fields indicate input fields without default values.
The ___0.5___ indicates an input field with a defrault value.
The [] fields indicate control buttons.
The form also needs a place for an error message such as if the user
enters a form width of 20 or a minimum margin that is too large.
I've read the documentation and several tutorials. I think I have a
general idea how to do this, but there are good ways to write code and
poor ways. I'd like to see one simple user form done with good coding
methods.
Thanks a bunch
PS: I'm posting this here, because there is almost no activity on
microsoft.public.word.vba.userforms. If this is the wrong place,
please advise.