View Single Post
  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Rcoppi Rcoppi is offline
external usenet poster
 
Posts: 9
Default Using Mail merge to enter and update information

Yes...unfortunately, I must use mail merge functionality to accomplish this
because the document generation program that calls this document was designed
to merge data from the program's database and from user input via mail merge
code. At some point in the future I would like to see if VBA will work with
my document generation program. I must say the mail merge functionality
works pretty well but it does have some limitations.
--
Rcoppi


"Graham Mayor" wrote:

Date calculations using fields are complicated. Most of the work has been
done for you - see the examples in fellow MVP Macropod's excellent work on
this topic, which can be downloaded from
http://www.gmayor.com/downloads.htm#Third_party
In the example substitute your Mergefield for the Date field(s).

Is this in fact a mail merge? You can use vba to insert calculated dates in
forms and documents, but we would need to know more to suggest the
appropriate code, but the basic format would be

Sub DatePlus60()
Dim bProtected As Boolean
'Unprotect the file
If ActiveDocument.ProtectionType wdNoProtection Then
bProtected = True
ActiveDocument.Unprotect
End If

Selection.InsertBefore Format((Date + 60), "d" & _
Chr(160) & "MMMM" & Chr(160) & "yyyy")

'Reprotect the document.
If bProtected = True Then
ActiveDocument.Protect _
Type:=wdAllowOnlyFormFields, NoReset:=True
End If
End Sub

See also http://www.gmayor.com/insert_a_date_...than_today.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Rcoppi wrote:
Hi,

I have several documents in which I enter a date in one location that
must be increased by 60 days in several other locations in the same
document. I've used ASK statements to automatically enter information
that is entered in response to my question in multiple locations in a
document, but I'm not sure how to do this, or if I even can do this.
Help!!!!