Está en la página 1de 2

Sub Dividir()

Application.ScreenUpdating = False
For i = ActiveDocument.Content.Information(wdActiveEndPageNumber) To 1 Step -1

ActiveDocument.Bookmarks("\Page").Range.Copy

Documents.Add

Selection.Paste
'----C�digo para m�rgenes de hoja-------------------------------------------
Selection.Delete Unit:=wdWord, Count:=-1
With Selection.Sections(1)
With .Borders(wdBorderLeft)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -587137025
End With
With .Borders(wdBorderRight)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -587137025
End With
With .Borders(wdBorderTop)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -587137025
End With
With .Borders(wdBorderBottom)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -587137025
End With
With .Borders
.DistanceFrom = wdBorderDistanceFromPageEdge
.AlwaysInFront = True
.SurroundHeader = True
.SurroundFooter = True
.JoinBorders = False
.DistanceFromTop = 24
.DistanceFromLeft = 24
.DistanceFromBottom = 31
.DistanceFromRight = 24
.Shadow = False
.EnableFirstPageInSection = True
.EnableOtherPagesInSection = True
.ApplyPageBordersToAllSections
End With
End With
With Options
.DefaultBorderLineStyle = wdLineStyleSingle
.DefaultBorderLineWidth = wdLineWidth050pt
.DefaultBorderColor = -587137025
End With
'----C�digo para m�rgenes de hoja-------------------------------------------
A = A + 1
'cambiar ruta por la que est�n ocupando
ChangeFileOpenDirectory "C:\Users\Fakto\Desktop\Exposici�n"
ActiveDocument.SaveAs2 FileName:=A & ".docx"
ActiveDocument.Close
'asegurarse de que el nombre coincida con el archivo de solicitudes
Documents("SOLICITUD DE SERVICIO.docx").Activate

Selection.GoTo what:=wdGoToPage, which:=wdGoToNext, Count:=1

Next i
Application.ScreenUpdating = True
End Sub

También podría gustarte