Yes it does thanks VBA Noob
Though I found one alittle easier to maniupulate from the same source.
Here is Macro to remove headers in all wqord documents in the current directory. Just have to open one Word Doc in that directory and then trigger the Macro Cooooool
Thanks
Sub Header_remover()
'Set "filenam" to the first matching file in the current folder.
filenam = Dir("*.doc*")
'Loop to open each matching file in the current folder.
Do While Len(filenam) > 0
On Error Resume Next
'Opens the file.
Documents.Open FileName:=filenam
'Continues execution if there was no error opening the file.
If Err = 0 Then
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.MoveDown Unit:=wdLine, Count:=4, Extend:=wdExtend
Selection.Cut
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.TypeParagraph
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.PasteAndFormat (wdPasteDefault)
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.PageSetup.TopMargin = InchesToPoints(0.44)
'Creates "newname" based on original Lotus file name.
newnam = Left(filenam, InStr(1, filenam, ".") - 1) & ".doc"
'Saves the new file as a Microsoft Excel normal file.
ActiveDocument.SaveAs FileName:=newnam, FileFormat:=xlNormal
'Closes the current file.
ActiveDocument.Close
Else
'Display message if opening filenam was unsuccessful.
MsgBox "Unable to Open file: " & CurDir() & "\" & filenam
'Resets error checking.
Err = 0
End If
'Gets the next file name
filenam = Dir()
'Repeats the loop for all matching files in the current folder.
Loop
End Sub
Bookmarks