Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / November 2007

Tip: Looking for answers? Try searching our database.

Using Mail merge to enter and update information

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rcoppi - 15 Nov 2007 22:29 GMT
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!!!!
Signature

Rcoppi

Graham Mayor - 16 Nov 2007 06:30 GMT
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_other_than_today.htm

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

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

> Hi,
>
[quoted text clipped - 4 lines]
> document, but I'm not sure how to do this, or if I even can do this.
> Help!!!!
Rcoppi - 16 Nov 2007 14:18 GMT
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.
Signature

Rcoppi

> 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
[quoted text clipped - 34 lines]
> > document, but I'm not sure how to do this, or if I even can do this.
> > Help!!!!
macropod - 16 Nov 2007 06:31 GMT
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/showthreaded.pl?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
Signature

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

> Hi,
>
[quoted text clipped - 3 lines]
> 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 - 16 Nov 2007 20:51 GMT
Macropod,

Thank you, this worked GREAT!!!!  
Signature

Rcoppi

> 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:
[quoted text clipped - 11 lines]
> > 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 - 27 Nov 2007 20:49 GMT
Signature

Rcoppi

> 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:
[quoted text clipped - 11 lines]
> > 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 - 27 Nov 2007 21:18 GMT
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.
Signature

Rcoppi

> 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:
[quoted text clipped - 11 lines]
> > 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!!!!
Doug Robbins - Word MVP - 28 Nov 2007 01:44 GMT
Put an autonew macro in the template that contains the command

ActiveDocument.Range.Fields.Update

Signature

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

> Dear Macropod,
>
[quoted text clipped - 50 lines]
>> > not
>> > sure how to do this, or if I even can do this.  Help!!!!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.