Hi! I have many html files that I want to open and copy its content in another document. The files are consecutive so I would like to write a macro that loops through them, open copy and close.
I have saved a macro and the code is:
Code:
Documents.Open FileName:="page_4.html", ConfirmConversions:=False, _
ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto, XMLTransform:=""
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=47, Extend:=wdExtend
Selection.Copy
Windows("Documento2").Activate
Windows("page_4").Activate
ActiveWindow.Close
the file that increases consecutively is page_4.html so I guess I need some for... and a way to name the file.
Thanks!!!