How to Print from Explorer without Date fields updating automatica

L

liquidator

I receive hundreds of Word 2002 Documents from 3rd parties that need to be
printed to an imaging system. Many of these have date fields that
automatically update when printed due to settings used when originally
created by the 3rd parties.

How can I turn this off globally to avoid having to manually open and edit
each Word 2002 document?

P.S. I'm using Word 2002/XP and Word 2003, same issues occurring on each.
 
G

Graham Mayor

The problem is likely to be that the documents have DATE fields when they
probably need CREATEDATE fields. DATE fields reflect the system date of the
PC, whereas CREATEDATE field reflect the date that the document was created.
You can confirm that by Pressing ALT+F9 and checking the field type. If that
is indeed the case the following macro will convert all the DATE fields to
CREATEDATE fields in all the docuemnts in a selected folder:

Sub BatchFixDates()
Dim myFile As String
Dim PathToUse As String
Dim myDoc As Document
Dim iFld As Integer
Dim fDialog As FileDialog
Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)

With fDialog
.Title = "Select Folder containing the documents to be modifed and click
OK"
.AllowMultiSelect = False
.InitialView = msoFileDialogViewList
If .Show <> -1 Then
MsgBox "Cancelled By User"
Exit Sub
End If
PathToUse = fDialog.SelectedItems.Item(1)
If Right(PathToUse, 1) <> "\" Then PathToUse = PathToUse + "\"
End With

If Documents.Count > 0 Then
Documents.Close Savechanges:=wdPromptToSaveChanges
End If

myFile = Dir$(PathToUse & "*.doc")

While myFile <> ""
Set myDoc = Documents.Open(PathToUse & myFile)
ActiveWindow.View.ShowFieldCodes = True
For iFld = ActiveDocument.Fields.Count To 1 Step -1
With ActiveDocument.Fields(iFld)
If .Type = wdFieldDate Then
.Code.Text = Replace(.Code.Text, "DATE", "CREATEDATE")
.Update
End If
End With
Next iFld
ActiveWindow.View.ShowFieldCodes = False
myDoc.Close Savechanges:=wdSaveChanges
myFile = Dir$()
Wend
End Sub

http://www.gmayor.com/installing_macro.htm

However, there are other types of date fields that may be involved. The
obvious one being PRINTDATE. If it is PRINTDATE fields (or some other field
type) that is the issue report back.


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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top