Abra o microsoft WORD, visualize, macro, visualize macro, crie um novo macro
Sub a()
Dim myDialogs As FileDialogs, oDoc As Documents, oSecs As Sections
Dim oFile As Variant, myRange As Range
Em caso de erro, retome a próxima etapa.
Defina uma caixa de diálogo para seleção de pastas.
Definir myDialogue=Application FileLog (msoFileDialogFilePicker)
Com myDialogs
. Filters. Clear ‘Clears all items in the file filters
. Filters. Add “All Word Files”, “*. doc, *. docx”, 1 ‘Add filters to all Word files
. AllowMultiSelect=True ‘Allow multiple selections
If Show=-1 Then ‘OK
For Each oFile In SelectedItems’ loop through all selected items
Defina oDoc=Documentos do Word Abrir (NomeDoArquivo:=oArquivo, Visível:=Falso)
Para cada oSec em oDoc Seções, percorra o documento dentro das seções
Defina myRange=oSec Cabeçalhos (wdHeaderFooterPrimary) Intervalo
MyRange Delete ‘Delete the content in the header
MyRange Text=”www.jincan. net”
MyRange ParagraphFormat Alignment=wdAlignParagraphCenter ‘Center text
MyRange ParagraphFormat Borders (wdBorderBottom) LineStyle=wdLineStyleNone ‘Paragraph bottom border line
Com a fonte myRange
Termine com
Defina myRange=oSec Rodapés (wdHeaderFooterPrimary) Intervalo
MyRange Delete ‘Delete the content in the footer
Meu intervalo Recolher wdCollapseEnd
Meu intervalo Inserir após o número da página
MyRange Fields Add Range:=myRange, Type:=wdFieldEmpty, Text:=”PAGE”, PreserveFormatting:=True
MyRange ParagraphFormat Alignment=wdAlignParagraphCenter ‘Center page numbers
Próximo
ODoc Fechar Verdadeiro
Próximo
Fim Se
Termine com
Fim da Sub
Whatsapp +8613603031172