R
Raul
I'm using the following code to remove the date field in a table in a header.
It was working on a batch of documents and then appeared to work on a second
batch of documents. The date field was replaced with "1" as dersired and the
document was saved. However when the document was opened the date field was
back.
One difference in the two batches of documents is I attached a new template
to documents in the second batch (with the issue).
Regardless, I still need the date field deleted permanently.
Can someone please help?
With ActiveDocument.StoryRanges(wdFirstPageHeaderStory).Tables(1)
' For c = 1 To .Columns.Count
c = .Columns.Count
For r = 2 To .Rows.Count
Set DateFieldRng = .Cell(r, c).Range
If DateFieldRng.Fields.Count > 1 Then
If DateFieldRng.Fields(1).Type = 31 Then
' DateFieldRng.Fields(1).Select
' Selection.Fields(1).Delete
DateFieldRng.Select
Selection.Delete
DateFieldRng.Text = 1
Exit For
End If
End If
Next r
' Next c
End With
Thanks in advance,
Raul
It was working on a batch of documents and then appeared to work on a second
batch of documents. The date field was replaced with "1" as dersired and the
document was saved. However when the document was opened the date field was
back.
One difference in the two batches of documents is I attached a new template
to documents in the second batch (with the issue).
Regardless, I still need the date field deleted permanently.
Can someone please help?
With ActiveDocument.StoryRanges(wdFirstPageHeaderStory).Tables(1)
' For c = 1 To .Columns.Count
c = .Columns.Count
For r = 2 To .Rows.Count
Set DateFieldRng = .Cell(r, c).Range
If DateFieldRng.Fields.Count > 1 Then
If DateFieldRng.Fields(1).Type = 31 Then
' DateFieldRng.Fields(1).Select
' Selection.Fields(1).Delete
DateFieldRng.Select
Selection.Delete
DateFieldRng.Text = 1
Exit For
End If
End If
Next r
' Next c
End With
Thanks in advance,
Raul