Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Wilson[_2_] Wilson[_2_] is offline
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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
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.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail merge to directory does not reset numbering in document Millieac Mailmerge 2 April 15th 10 11:32 PM
Mail merge: reopening saved document prompts for SQL command twice Tonne Mailmerge 3 September 24th 09 11:46 AM
hyperlinks change on closing and reopening file JrC Microsoft Word Help 3 May 21st 08 07:10 PM
How to get all mail merge fields in a document [email protected] Mailmerge 3 February 17th 06 05:43 AM
Copy a Mail Merge Query to a new document Paul Brown Mailmerge 2 March 3rd 05 01:43 AM


All times are GMT +1. The time now is 03:17 PM.

Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright 2004-2023 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"