I have a macro that replaced the header and footer of all documents in a directory with the one in the document that I run the macro from. I have a field in the footer that shows the document name - this updates with every document however shows the .doc extension. Is there anyway to remove this extension from every field with FileName in please?
Code updating the footer and the field:
For Each HdFt In .Sections.First.Footers
If HdFt.Exists Then
If wdDocSrc.Sections.First.Footers(HdFt.Index).Exists Then
HdFt.Range.FormattedText = wdDocSrc.Sections.First.Footers(HdFt.Index).Range.FormattedText
For Each aStory In wdDocTgt.StoryRanges
For Each aField In aStory.Fields