You are on page 1of 1

Sub GUARDAR_HOJAS()

Dim NUME_PAGINAS As Integer


Dim NUM_DOC As Integer
Dim PAG_INICIAL As Integer
Dim PAGINA_FINAL As Integer
Dim URL As String
Dim NOMBRES As String

Num_PAGINAS = InputBox("INGRESE EL NUMERO DE PAGINAS POR DOCUMENTOS")


NUM_DOC = InputBox("¿CUANTOS DOCUMENTOS DESEA GENERAR?")
URL = InputBox("¿DONDE DESEA CREAR LOS DOCUMENTOS?")
NOMBRES = InputBox("¿QUE NOMBRE TENDRAN LOS DOCUMENTOS?")
PAG_INICIAL = 1
PAGINA_FINAL = Num_PAGINAS

For i = 1 To NUM_DOC
ActiveDocument.ExportAsFixedFormat OUTPUTFILENAME:= _
URL & "\" & NOMBRESM & i & ".PDF", EXPORTFORMAT:= _
wdExportFormatPDF, OPENAFTEREXPORT:=False, OPTIMIZEFOR:= _
wdExportOptimizeForPrint, Range:=wdExportFromTo, FROM:=PAG_INICIAL,
TO:=PAGINA_FINAL, Item:= _
wdExportDocumentContent, INCLUDEDOCPROPS:=True, KEEPIRM:=True, _
CREATEBOOKMARKS:=wdExportCreateNoBookmarks, DOCSTRUCTURETAGS:=True, _
BITMAPMISSINGFONTS:=True, USEISO19005_1:=False
ChangeFileOpenDirectory URL

PAG_INICIAL = PAGINA_FINAL + 1
PAGINA_FINAL = PAGINA_FINAL + Num_PAGINAS
Next i

End Sub

You might also like