Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Making a UserForm that persists
The way a UserForm behaves is, it appears as you open a document from a
template. The user fills in the blanks, clicks on the commandbutton, and the data he typed is populated throughout the document. But if he discovers that he made a typo, there's no way to re-open the userform and correct his entry...he has to start all over again. Is there a way around this behavior, ie, a way to have the data he typed, remain in the userform, and enable the userform to be re-opened and re-edited unti the user is satisfied? |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Making a UserForm that persists
Bob W wrote:
The way a UserForm behaves is, it appears as you open a document from a template. The user fills in the blanks, clicks on the commandbutton, and the data he typed is populated throughout the document. But if he discovers that he made a typo, there's no way to re-open the userform and correct his entry...he has to start all over again. Is there a way around this behavior, ie, a way to have the data he typed, remain in the userform, and enable the userform to be re-opened and re-edited unti the user is satisfied? Of course there is. It just takes more planning and effort in setting up the UserForm's code. A UserForm appears when you open a document, only because there's a macro named AutoOpen (stored in the document's template) that contains code to show the UserForm. You can -- in addition or instead -- write another macro that also shows the UserForm, and assign that macro to a toolbar button or keyboard shortcut, or you can make it the entry macro of a form field (if you're using a protected form). The other part of this is to provide code -- in the launch macro or in the UserForm's Initialize procedure -- to fill the UserForm's controls with the data that's already in the document. That way the user can just edit the specific items that need to change, instead of reentering everything. Exactly how that code is written depends on how the information is represented in the document, whether in bookmarks or form fields or document variables or an external source (e.g., a database). For specific questions about modifying an existing form, please post in the newsgroup microsoft.public.word.vba.userforms (http://www.microsoft.com/office/comm...a.userform s). -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Userform Template | Microsoft Word Help | |||
Userform | Microsoft Word Help | |||
Userform in word | Microsoft Word Help | |||
Userform - .Range_ | Microsoft Word Help | |||
creating a userform | Microsoft Word Help |