Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Can I reset a mail merge document ASK/REF fields instead of closing and reopening another copy ?
I have a form.dot with a number of ASK then REF fields. The REF fields use
dates and data obtained via the ASK fields. A new copy of the form is opened (form.doc) then once the form is completed it is printed and then used again. Right now we have to actually close the form (the form and data is not saved or reused) then open a new copy of the form to enter new data. Sometimes we do this 20+ times for different customers, one after another. Is there some way I can have a macro in the form which simply resets the ASK/REF fields to blank then "re-opens" a new copy of the form. Or do I have to actually close the copy I have open and get a new copy of the form each time ? I am using Word XP. thanks .. Wilson R. |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Can I reset a mail merge document ASK/REF fields instead of closing and reopening another copy ?
Your form should be saved as a template and then you would use FileNew to
create a new document from the template each time you need to start a new form. Instead of ASK fields you may want to consider using FormFields, or whether a userform is not a better way for you. See http://www.mousetrax.com/techpage.html#autoforms Please Fill Out This Form Part 1: Create professional looking forms in Word http://www.computorcompanion.com/LPMArticle.asp?ID=22 Part 2: Adding Automation to your Word forms. http://www.computorcompanion.com/LPMArticle.asp?ID=46 Part 3: Learn more VBA (macros) to automate your forms. http://www.computorcompanion.com/LPMArticle.asp?ID=119 Part 4: Use custom dialog boxes in your Word forms http://www.computorcompanion.com/LPMArticle.asp?ID=127 Part 5: Connect your AutoForm to a database to save input time and keep better records! http://www.computorcompanion.com/LPMArticle.asp?ID=136 and http://gregmaxey.mvps.org/Repeating_Data.htm http://gregmaxey.mvps.org/Create_and...a_UserForm.htm http://gregmaxey.mvps.org/Populate_UserForm_ListBox.htm -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "Wilson" wrote in message ... I have a form.dot with a number of ASK then REF fields. The REF fields use dates and data obtained via the ASK fields. A new copy of the form is opened (form.doc) then once the form is completed it is printed and then used again. Right now we have to actually close the form (the form and data is not saved or reused) then open a new copy of the form to enter new data. Sometimes we do this 20+ times for different customers, one after another. Is there some way I can have a macro in the form which simply resets the ASK/REF fields to blank then "re-opens" a new copy of the form. Or do I have to actually close the copy I have open and get a new copy of the form each time ? I am using Word XP. thanks .. Wilson R. |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Can I reset a mail merge document ASK/REF fields instead of closing and reopening another copy ?
While I agree with Doug that the usual way forward is to save the document
as a template and create new documents each time from the template, given that you are not saving the document and do not need to retain the data after printing, you could simply update the fields in the document. The macro used as an example at http://www.gmayor.com/installing_macro.htm will do that. I would also go along with Doug's suggestion to use instead a protected form or a userform to gather the data rather than a sequence of ask fields. If you want to reset form fields you can do that with the following macro Sub ResetFormFields() Dim bProtected As Boolean Dim oFld As FormFields Dim i As Long Set oFld = ActiveDocument.FormFields If ActiveDocument.ProtectionType wdNoProtection Then bProtected = True ActiveDocument.Unprotect Password:="" End If For i = 1 To oFld.Count With oFld(i) .Select Select Case .Type Case Is = wdFieldFormTextInput oFld(i).Result = "" Case Is = wdFieldFormDropDown oFld(i).Result = oFld(i).DropDown.ListEntries(1).name Case Is = wdFieldFormCheckBox oFld(i).CheckBox.Value = False End Select End With Next i If bProtected = True Then ActiveDocument.Protect _ Type:=wdAllowOnlyFormFields, NoReset:=True, Password:="" End If oFld(1).Select End Sub and in the case of the userform - you can simply recall the userform. For the basics, see Word MVP FAQ - Userforms http://word.mvps.org/FAQs/Userforms.htm for a more in depth explanation, see http://gregmaxey.mvps.org/Create_and...a_UserForm.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org "Wilson" wrote in message ... I have a form.dot with a number of ASK then REF fields. The REF fields use dates and data obtained via the ASK fields. A new copy of the form is opened (form.doc) then once the form is completed it is printed and then used again. Right now we have to actually close the form (the form and data is not saved or reused) then open a new copy of the form to enter new data. Sometimes we do this 20+ times for different customers, one after another. Is there some way I can have a macro in the form which simply resets the ASK/REF fields to blank then "re-opens" a new copy of the form. Or do I have to actually close the copy I have open and get a new copy of the form each time ? I am using Word XP. thanks .. Wilson R. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mail merge to directory does not reset numbering in document | Mailmerge | |||
Mail merge: reopening saved document prompts for SQL command twice | Mailmerge | |||
hyperlinks change on closing and reopening file | Microsoft Word Help | |||
How to get all mail merge fields in a document | Mailmerge | |||
Copy a Mail Merge Query to a new document | Mailmerge |