Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Set a global date in a word document
I created a template of a document which contains the same date in different
places with different formats (YYYY/MM, d MM YYYY, etc.). When I use the template, I would like to set the date in a unique place and have Word update all dates for me. I am using Word 2007, how do you suggest to proceed? Thanks |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Set a global date in a word document
Bookmark the date in that unique place (select and choose Insert -
Bookmark), then insert references (press Ctrl+F9, type ref bookmarkname, then press F9) to it where you want it to appear. You would need to update (select and press F9) the reference fields when the original source date changes. -- Herb Tyson MS MVP Author of the Word 2007 Bible Blog: http://word2007bible.herbtyson.com Web: http://www.herbtyson.com "giovanni" wrote in message ... I created a template of a document which contains the same date in different places with different formats (YYYY/MM, d MM YYYY, etc.). When I use the template, I would like to set the date in a unique place and have Word update all dates for me. I am using Word 2007, how do you suggest to proceed? Thanks |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Set a global date in a word document
To add to Herb's reply, as long as the date you bookmark has a legitimate
date format, you can use formatting switches on the REF field to provide any other legitimate date format eg { REF bDate \@ "YYYY/MM" } { REF bDate \@ "d MM yyyy" } You might find it convenient to use a pop up calendar associated with an autonew macro to select the initial date and avoid errors - see http://www.gmayor.com/popup_calendar.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org giovanni wrote: I created a template of a document which contains the same date in different places with different formats (YYYY/MM, d MM YYYY, etc.). When I use the template, I would like to set the date in a unique place and have Word update all dates for me. I am using Word 2007, how do you suggest to proceed? Thanks |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Set a global date in a word document
Thank you, that was very helpful. I do have another problem though: the
particular document I am working on is in French, though the OS and Office are in English (most of my other documents are in English), so Word does not recognise the French month names as valid dates (if I replace the French word for the equivalent english one I have no problems). I tried setting French as the default language for this particular template, but that did not affect the result. Can I force the date to be in French? NOTE: I do have a French dictionary and I can correctly insert date in French format. "Graham Mayor" wrote: To add to Herb's reply, as long as the date you bookmark has a legitimate date format, you can use formatting switches on the REF field to provide any other legitimate date format eg { REF bDate \@ "YYYY/MM" } { REF bDate \@ "d MM yyyy" } You might find it convenient to use a pop up calendar associated with an autonew macro to select the initial date and avoid errors - see http://www.gmayor.com/popup_calendar.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org giovanni wrote: I created a template of a document which contains the same date in different places with different formats (YYYY/MM, d MM YYYY, etc.). When I use the template, I would like to set the date in a unique place and have Word update all dates for me. I am using Word 2007, how do you suggest to proceed? Thanks |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Set a global date in a word document
If you use a REF field to reproduce the date and format that date field as
language = French then the formatting switches will insert the days and months with their French language equivalents e.g. {REF bDate \@ "dddd, d MMMM yyyy" } should produce jeudi, 8 janvier 2009 Do the French capitalise their days and months? It's been a while ... but if they do you can add a Caps switch { Date \@ "dddd, d MMMM yyyy" \*Caps } to produce Jeudi, 8 Janvier 2009 Probably even simpler where different languages are involved is to take my previous suggestion of using the pop up calendar to collect the date (assuming the initial date cannot be derived from a CreateDate field?) and assign the result from the calendar to a docvariable. You can then use docvariable fields FORMATTED WITH THE FRENCH language attribute, wherever you want to insert the date e.g. { DOCVARIABLE varDate \@ "dddd d MMMM yyyy"} { DOCVARIABLE varDate \@ "d MMM yyyy"} { DOCVARIABLE varDate \@ " MM yyyy"} to show jeudi 8 janvier 2009 8 janv. 2009 01 2009 respectively. The revised code associated with the calendar form to achieve that would be Private Sub Calendar1_Click() Dim oVars As Variables Dim i As Long Set oVars = ActiveDocument.Variables oVars("varDate").Value = _ format(Calendar1.Value, "dd MM yyyy") For i = ActiveDocument.Fields.Count To 1 Step -1 With ActiveDocument.Fields(i) If .Type = wdFieldDocVariable Then .Update End With Next i Unload Me End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org giovanni wrote: Thank you, that was very helpful. I do have another problem though: the particular document I am working on is in French, though the OS and Office are in English (most of my other documents are in English), so Word does not recognise the French month names as valid dates (if I replace the French word for the equivalent english one I have no problems). I tried setting French as the default language for this particular template, but that did not affect the result. Can I force the date to be in French? NOTE: I do have a French dictionary and I can correctly insert date in French format. "Graham Mayor" wrote: To add to Herb's reply, as long as the date you bookmark has a legitimate date format, you can use formatting switches on the REF field to provide any other legitimate date format eg { REF bDate \@ "YYYY/MM" } { REF bDate \@ "d MM yyyy" } You might find it convenient to use a pop up calendar associated with an autonew macro to select the initial date and avoid errors - see http://www.gmayor.com/popup_calendar.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org giovanni wrote: I created a template of a document which contains the same date in different places with different formats (YYYY/MM, d MM YYYY, etc.). When I use the template, I would like to set the date in a unique place and have Word update all dates for me. I am using Word 2007, how do you suggest to proceed? Thanks |
#6
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Set a global date in a word document
Thank you for your reply. The problem is not the formatting of the referenced
dates but of the input date: when I select a date such as "8 septembre 2006" to bookmark it, Word is not recognizing "septembre" as a valid month even though I selected the language for the document to be French. To have the french word recognized as a valid month, I have to change the "Primary Editing Language" to French under the Office 2007 Language Settings. However this way all new documents are based on the French standard by default, while I would like to do so only for the current document template. Do you have any suggestions? "Graham Mayor" wrote: If you use a REF field to reproduce the date and format that date field as language = French then the formatting switches will insert the days and months with their French language equivalents e.g. {REF bDate \@ "dddd, d MMMM yyyy" } should produce jeudi, 8 janvier 2009 Do the French capitalise their days and months? It's been a while ... but if they do you can add a Caps switch { Date \@ "dddd, d MMMM yyyy" \*Caps } to produce Jeudi, 8 Janvier 2009 Probably even simpler where different languages are involved is to take my previous suggestion of using the pop up calendar to collect the date (assuming the initial date cannot be derived from a CreateDate field?) and assign the result from the calendar to a docvariable. You can then use docvariable fields FORMATTED WITH THE FRENCH language attribute, wherever you want to insert the date e.g. { DOCVARIABLE varDate \@ "dddd d MMMM yyyy"} { DOCVARIABLE varDate \@ "d MMM yyyy"} { DOCVARIABLE varDate \@ " MM yyyy"} to show jeudi 8 janvier 2009 8 janv. 2009 01 2009 respectively. The revised code associated with the calendar form to achieve that would be Private Sub Calendar1_Click() Dim oVars As Variables Dim i As Long Set oVars = ActiveDocument.Variables oVars("varDate").Value = _ format(Calendar1.Value, "dd MM yyyy") For i = ActiveDocument.Fields.Count To 1 Step -1 With ActiveDocument.Fields(i) If .Type = wdFieldDocVariable Then .Update End With Next i Unload Me End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org giovanni wrote: Thank you, that was very helpful. I do have another problem though: the particular document I am working on is in French, though the OS and Office are in English (most of my other documents are in English), so Word does not recognise the French month names as valid dates (if I replace the French word for the equivalent english one I have no problems). I tried setting French as the default language for this particular template, but that did not affect the result. Can I force the date to be in French? NOTE: I do have a French dictionary and I can correctly insert date in French format. "Graham Mayor" wrote: To add to Herb's reply, as long as the date you bookmark has a legitimate date format, you can use formatting switches on the REF field to provide any other legitimate date format eg { REF bDate \@ "YYYY/MM" } { REF bDate \@ "d MM yyyy" } You might find it convenient to use a pop up calendar associated with an autonew macro to select the initial date and avoid errors - see http://www.gmayor.com/popup_calendar.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org giovanni wrote: I created a template of a document which contains the same date in different places with different formats (YYYY/MM, d MM YYYY, etc.). When I use the template, I would like to set the date in a unique place and have Word update all dates for me. I am using Word 2007, how do you suggest to proceed? Thanks |
#7
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Set a global date in a word document
I have just given you a suggestion. Insert the date by macro and format the
document as French. Then you don't have to worry about the language format of the date in the document as that date will be that inserted by the macro/docvariable fields. Your comments about septembre not being recognized by the REF field is not limited to Word 2007 and I don't know of a way around it using the bookmark method ... though you could use an ASK field to collect the date in a numeric format eg dd\MM\yy. Picking the date from a calendar avoids incorrect date insertion. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org giovanni wrote: Thank you for your reply. The problem is not the formatting of the referenced dates but of the input date: when I select a date such as "8 septembre 2006" to bookmark it, Word is not recognizing "septembre" as a valid month even though I selected the language for the document to be French. To have the french word recognized as a valid month, I have to change the "Primary Editing Language" to French under the Office 2007 Language Settings. However this way all new documents are based on the French standard by default, while I would like to do so only for the current document template. Do you have any suggestions? "Graham Mayor" wrote: If you use a REF field to reproduce the date and format that date field as language = French then the formatting switches will insert the days and months with their French language equivalents e.g. {REF bDate \@ "dddd, d MMMM yyyy" } should produce jeudi, 8 janvier 2009 Do the French capitalise their days and months? It's been a while ... but if they do you can add a Caps switch { Date \@ "dddd, d MMMM yyyy" \*Caps } to produce Jeudi, 8 Janvier 2009 Probably even simpler where different languages are involved is to take my previous suggestion of using the pop up calendar to collect the date (assuming the initial date cannot be derived from a CreateDate field?) and assign the result from the calendar to a docvariable. You can then use docvariable fields FORMATTED WITH THE FRENCH language attribute, wherever you want to insert the date e.g. { DOCVARIABLE varDate \@ "dddd d MMMM yyyy"} { DOCVARIABLE varDate \@ "d MMM yyyy"} { DOCVARIABLE varDate \@ " MM yyyy"} to show jeudi 8 janvier 2009 8 janv. 2009 01 2009 respectively. The revised code associated with the calendar form to achieve that would be Private Sub Calendar1_Click() Dim oVars As Variables Dim i As Long Set oVars = ActiveDocument.Variables oVars("varDate").Value = _ format(Calendar1.Value, "dd MM yyyy") For i = ActiveDocument.Fields.Count To 1 Step -1 With ActiveDocument.Fields(i) If .Type = wdFieldDocVariable Then .Update End With Next i Unload Me End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org giovanni wrote: Thank you, that was very helpful. I do have another problem though: the particular document I am working on is in French, though the OS and Office are in English (most of my other documents are in English), so Word does not recognise the French month names as valid dates (if I replace the French word for the equivalent english one I have no problems). I tried setting French as the default language for this particular template, but that did not affect the result. Can I force the date to be in French? NOTE: I do have a French dictionary and I can correctly insert date in French format. "Graham Mayor" wrote: To add to Herb's reply, as long as the date you bookmark has a legitimate date format, you can use formatting switches on the REF field to provide any other legitimate date format eg { REF bDate \@ "YYYY/MM" } { REF bDate \@ "d MM yyyy" } You might find it convenient to use a pop up calendar associated with an autonew macro to select the initial date and avoid errors - see http://www.gmayor.com/popup_calendar.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org giovanni wrote: I created a template of a document which contains the same date in different places with different formats (YYYY/MM, d MM YYYY, etc.). When I use the template, I would like to set the date in a unique place and have Word update all dates for me. I am using Word 2007, how do you suggest to proceed? Thanks |
#8
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Set a global date in a word document
I am so sorry, I did not read your post fully and I did not see the calenda
pop up suggestion! My bad, thank you very much for your answer! "Graham Mayor" wrote: I have just given you a suggestion. Insert the date by macro and format the document as French. Then you don't have to worry about the language format of the date in the document as that date will be that inserted by the macro/docvariable fields. Your comments about septembre not being recognized by the REF field is not limited to Word 2007 and I don't know of a way around it using the bookmark method ... though you could use an ASK field to collect the date in a numeric format eg dd\MM\yy. Picking the date from a calendar avoids incorrect date insertion. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org giovanni wrote: Thank you for your reply. The problem is not the formatting of the referenced dates but of the input date: when I select a date such as "8 septembre 2006" to bookmark it, Word is not recognizing "septembre" as a valid month even though I selected the language for the document to be French. To have the french word recognized as a valid month, I have to change the "Primary Editing Language" to French under the Office 2007 Language Settings. However this way all new documents are based on the French standard by default, while I would like to do so only for the current document template. Do you have any suggestions? "Graham Mayor" wrote: If you use a REF field to reproduce the date and format that date field as language = French then the formatting switches will insert the days and months with their French language equivalents e.g. {REF bDate \@ "dddd, d MMMM yyyy" } should produce jeudi, 8 janvier 2009 Do the French capitalise their days and months? It's been a while ... but if they do you can add a Caps switch { Date \@ "dddd, d MMMM yyyy" \*Caps } to produce Jeudi, 8 Janvier 2009 Probably even simpler where different languages are involved is to take my previous suggestion of using the pop up calendar to collect the date (assuming the initial date cannot be derived from a CreateDate field?) and assign the result from the calendar to a docvariable. You can then use docvariable fields FORMATTED WITH THE FRENCH language attribute, wherever you want to insert the date e.g. { DOCVARIABLE varDate \@ "dddd d MMMM yyyy"} { DOCVARIABLE varDate \@ "d MMM yyyy"} { DOCVARIABLE varDate \@ " MM yyyy"} to show jeudi 8 janvier 2009 8 janv. 2009 01 2009 respectively. The revised code associated with the calendar form to achieve that would be Private Sub Calendar1_Click() Dim oVars As Variables Dim i As Long Set oVars = ActiveDocument.Variables oVars("varDate").Value = _ format(Calendar1.Value, "dd MM yyyy") For i = ActiveDocument.Fields.Count To 1 Step -1 With ActiveDocument.Fields(i) If .Type = wdFieldDocVariable Then .Update End With Next i Unload Me End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org giovanni wrote: Thank you, that was very helpful. I do have another problem though: the particular document I am working on is in French, though the OS and Office are in English (most of my other documents are in English), so Word does not recognise the French month names as valid dates (if I replace the French word for the equivalent english one I have no problems). I tried setting French as the default language for this particular template, but that did not affect the result. Can I force the date to be in French? NOTE: I do have a French dictionary and I can correctly insert date in French format. "Graham Mayor" wrote: To add to Herb's reply, as long as the date you bookmark has a legitimate date format, you can use formatting switches on the REF field to provide any other legitimate date format eg { REF bDate \@ "YYYY/MM" } { REF bDate \@ "d MM yyyy" } You might find it convenient to use a pop up calendar associated with an autonew macro to select the initial date and avoid errors - see http://www.gmayor.com/popup_calendar.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org giovanni wrote: I created a template of a document which contains the same date in different places with different formats (YYYY/MM, d MM YYYY, etc.). When I use the template, I would like to set the date in a unique place and have Word update all dates for me. I am using Word 2007, how do you suggest to proceed? Thanks |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Print a word Document with creation date not printed date | Microsoft Word Help | |||
Global Changes to Multiple Tables in the Same Document | Microsoft Word Help | |||
Global document formatting | Microsoft Word Help | |||
Word Document saved with date later retrieved with current date | Microsoft Word Help | |||
How do i update a word document date field with a future date | Microsoft Word Help |