Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]() -- 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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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 | |
|
|
![]() |
||||
Thread | Forum | |||
can you take information from a chart and put it into a mail merge | Mailmerge | |||
How do i get job title information to display in mail merge? | Mailmerge | |||
can I export information from excel into mail merge for labeling? | Mailmerge | |||
Why is the WORD mail merge truncating information? | Mailmerge | |||
How do I update information on a master mail merge list? | Mailmerge |