Page 1 of 1

Replace old date with current date

Posted: Tue Jan 22, 2013 2:06 am
by TomQA
Hello,
How do I replace a date in a Word custom property with a new date, or better, the current date? Using a date format of mm/dd/yy.
I searched for *\/*\/* and wanted to replace with 01/21/13, but nothing was replaced.

Thank you.

Re: Replace old date with current date

Posted: Wed Jan 23, 2013 8:40 pm
by DataMystic Support
Did you have wildcards switched on?

Try:

Code: Select all

[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{1,2}

Re: Replace old date with current date

Posted: Thu Jan 24, 2013 3:14 pm
by TomQA
Hi Simon,
I did not try Wildcards. The date is in the Custom Property, "EffectiveDate". My goal is to find the current date and replace it with the current date. The entire footer looks like this:

FSSQA-F102/5.2 Corrective Preventive Action Request Page 1 of 1 Approved: TFS Effective: 4/3/2008

Your solution didn't make any changes, but then I didn't give you all of the information.
What can I try next?

Thank you,

Tom

Re: Replace old date with current date

Posted: Fri Jan 25, 2013 2:29 pm
by DataMystic Support
If the date is in the Custom Property, did you set the search location to 'Custom properties'?

The wildcards I gave you won't work in the footer, instead, use the EasyPattern Search Replace type of:

Code: Select all

[ 1-2 digits ]/[ 1-2 digits ]/[ 4 digits ]

Re: Replace old date with current date

Posted: Sat Jan 26, 2013 3:25 pm
by TomQA
Hi Simon,

I had chosen Custom Properties in Search Location and the new code changed the value of the Custom Property, EffectiveDate. However, the date shown in the footer did not change, in other words, the document didn't refresh. I had to press F9 to force the update. Can WordPipe force a field update?

Tom

Re: Replace old date with current date

Posted: Sat Jan 26, 2013 3:28 pm
by DataMystic Support
Yes! See the Options tab, Update field codes before save.

Re: Replace old date with current date

Posted: Sun Jan 27, 2013 6:26 am
by TomQA
Hi Simon,

I had "Update field codes before save" checked and it did not update. Things just got really serious for me because I thought I had only 135 files to change, but I have 548 files! WordPipe is the only possible solution for me. If its alright with you, I'd like to combine this thread with my other thread on replacing the hyphen.
To reinterate, I'm using Word 2010 and my documents are a variety of .DOC, .DOCX, .DOTX .DOTM. The footer text is giving me all the trouble. The text that needs to be changed in the footers look like this:
FSSQA-F102/5.2 Effective: 4/3/2008
I need to make the footers look like this:
FSQA-F102-5.2 Effective: 2/1/13
The "FSS" becomes "FS" and the text "QA" will change depending on the document, as will the number following the "F" and before the "/". The number is one to three digits. In this example, the text in "FSSQA-F102" is in the "Document number" Built-in property field, the "5.2" is in the "DocRevision" Custom property field. The date is in the "EffectiveDate" Custom property field. The documents are protected, but the "unprotect" feature is working fine. I know this because that changes to the body text are correct.

Again, thank you for your time.

- Tom

Re: Replace old date with current date

Posted: Sun Jan 27, 2013 7:57 am
by DataMystic Support
Hi Tom,

The Options tab, Update field codes before save, will only occur if a change has been made to the document. So you might need to replace e.g FS with FS (ie itself) to trigger this change. Checking Options\Force Word to save changes may also help.

Please send us a sample document and your settings, either by zipping and uploading here in the forums, or by sending to our email address.

Re: Replace old date with current date

Posted: Sun Jan 27, 2013 11:35 am
by TomQA
Hi Simon,

There are several changes made to the document in the body, as well as in the footer. Attached are a sample document, not protected and one of my many WordPipe .wpp files.
8-Replace forward slash and Effective Date.zip
WordPipe file
(1.09 KiB) Downloaded 1203 times
FSSQA-F2 Corrective Action.zip
form needing changes
(22.21 KiB) Downloaded 1118 times
Thank you!!

Tom