A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Can I reset a mail merge document ASK/REF fields instead of closing and reopening another copy ?



 
 
Thread Tools Display Modes
  #1  
Old May 11th, 2010, 08:35 PM posted to microsoft.public.word.mailmerge.fields
Wilson
external usenet poster
 
Posts: 1
Default 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  
Old May 11th, 2010, 09:40 PM posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default 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  
Old May 12th, 2010, 05:41 AM posted to microsoft.public.word.mailmerge.fields
Graham Mayor
external usenet poster
 
Posts: 18,297
Default 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.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:04 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.