Reply
 
Thread Tools Display Modes
  #1   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

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!!!!
--
Rcoppi
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Using Mail merge to enter and update information

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!!!!



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod macropod is offline
external usenet poster
 
Posts: 1,002
Default Using Mail merge to enter and update information

To see how to do this and just about everything else you might want to do
with dates in Word, check out my Date Calc 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/show...?Number=249902
or
http://www.gmayor.com/downloads.htm#Third_party
In particular, look at the item titled 'Date and Time Calculations In A Mailmerge'

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"Rcoppi" wrote in message ...
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!!!!
--
Rcoppi

  #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!!!!




  #5   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

Macropod,

Thank you, this worked GREAT!!!!
--
Rcoppi


"macropod" wrote:

To see how to do this and just about everything else you might want to do
with dates in Word, check out my Date Calc 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/show...?Number=249902
or
http://www.gmayor.com/downloads.htm#Third_party
In particular, look at the item titled 'Date and Time Calculations In A Mailmerge'

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"Rcoppi" wrote in message ...
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!!!!
--
Rcoppi




  #6   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


--
Rcoppi


"macropod" wrote:

To see how to do this and just about everything else you might want to do
with dates in Word, check out my Date Calc 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/show...?Number=249902
or
http://www.gmayor.com/downloads.htm#Third_party
In particular, look at the item titled 'Date and Time Calculations In A Mailmerge'

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"Rcoppi" wrote in message ...
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!!!!
--
Rcoppi


  #7   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

Dear Macropod,

Help.... my date calculation does not automatically update based on the
current date. This is the calculation I have in my document and it works
great the day I added to the document, but it does not update. The document
I am adding this calculation to is a template that is used daily by my users,
what do I need to add to the calculation to make it automatically update
whenever the document is generated.

For example, User #1 generates the document (using my template) on November
26th, I need the date of January 25, 2008 to be entered wherever I have the
date calculation logic. Then User #2 generates the same document (using my
template) on November 27, 2007. I need the date of January 26, 2008 to be
entered wherever I have the date calculation logic.

This is the date calculation logic I am using.
{QUOTE{{DATE /@ €œMMMM d, yyyy€ \* MERGEFORMAT}}{set Delay €œ60€}{SET
d{StartDate \@ d}}{SET m{ StartDate \@ MM}}{StartDate \@ yyyy }}{SET
jd{=INT(365.25*(y+4799+INT((m+10)/12)))+INT(367/12*MOD(m+10,12))-INT(3*INT((y+4901+INT((m+10)/12))/100)/4)+d-32075}}{SET
jd{=jd+Delay }}{SET c
{=jd+68569-INT(36524.25*INT((jd+68569)/36524.25)+0.75)}}{ SET
f{=c-INT(365.25*INT((c+1)/365.25025))+31}}{SET
dd{=f-INT(30.58757*INT(f/30.58757))}}{SET
mm"{=INT(f/30.58757)+2-12*INT(INT(f/30.58757)/11)} /00"}{SET
yy{=100*(INT((jd+68569)/36524.25)-49)+INT((c+1)/365.25025)+INT(INT(f/30.58757)/11)}}{mm \@ MMMM } 160{dd}, 160{yy}€€}

Your help is GREATLY appreicated.
--
Rcoppi


"macropod" wrote:

To see how to do this and just about everything else you might want to do
with dates in Word, check out my Date Calc 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/show...?Number=249902
or
http://www.gmayor.com/downloads.htm#Third_party
In particular, look at the item titled 'Date and Time Calculations In A Mailmerge'

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"Rcoppi" wrote in message ...
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!!!!
--
Rcoppi


  #8   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 Using Mail merge to enter and update information

Put an autonew macro in the template that contains the command

ActiveDocument.Range.Fields.Update

--
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

"Rcoppi" wrote in message
...
Dear Macropod,

Help.... my date calculation does not automatically update based on the
current date. This is the calculation I have in my document and it works
great the day I added to the document, but it does not update. The
document
I am adding this calculation to is a template that is used daily by my
users,
what do I need to add to the calculation to make it automatically update
whenever the document is generated.

For example, User #1 generates the document (using my template) on
November
26th, I need the date of January 25, 2008 to be entered wherever I have
the
date calculation logic. Then User #2 generates the same document (using
my
template) on November 27, 2007. I need the date of January 26, 2008 to be
entered wherever I have the date calculation logic.

This is the date calculation logic I am using.
{QUOTE{{DATE /@ "MMMM d, yyyy" \* MERGEFORMAT}}{set Delay "60"}{SET
d{StartDate \@ d}}{SET m{ StartDate \@ MM}}{StartDate \@ yyyy }}{SET
jd{=INT(365.25*(y+4799+INT((m+10)/12)))+INT(367/12*MOD(m+10,12))-INT(3*INT((y+4901+INT((m+10)/12))/100)/4)+d-32075}}{SET
jd{=jd+Delay }}{SET c
{=jd+68569-INT(36524.25*INT((jd+68569)/36524.25)+0.75)}}{ SET
f{=c-INT(365.25*INT((c+1)/365.25025))+31}}{SET
dd{=f-INT(30.58757*INT(f/30.58757))}}{SET
mm"{=INT(f/30.58757)+2-12*INT(INT(f/30.58757)/11)} /00"}{SET
yy{=100*(INT((jd+68569)/36524.25)-49)+INT((c+1)/365.25025)+INT(INT(f/30.58757)/11)}}{mm
\@ MMMM } 160{dd}, 160{yy}""}

Your help is GREATLY appreicated.
--
Rcoppi


"macropod" wrote:

To see how to do this and just about everything else you might want to do
with dates in Word, check out my Date Calc 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/show...?Number=249902
or
http://www.gmayor.com/downloads.htm#Third_party
In particular, look at the item titled 'Date and Time Calculations In A
Mailmerge'

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"Rcoppi" wrote in message
...
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!!!!
--
Rcoppi




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
can you take information from a chart and put it into a mail merge cj Mailmerge 1 August 1st 07 04:02 AM
How do i get job title information to display in mail merge? Ldydi525 Mailmerge 4 August 26th 06 02:21 AM
can I export information from excel into mail merge for labeling? Wendy Mailmerge 1 July 13th 06 10:34 PM
Why is the WORD mail merge truncating information? KristineB Mailmerge 3 June 14th 05 09:31 AM
How do I update information on a master mail merge list? mlevenson Mailmerge 1 April 9th 05 09:54 AM


All times are GMT +1. The time now is 04:15 PM.

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

About Us

"It's about Microsoft Word"