Professional Documents
Culture Documents
Macros Word
Macros Word
'
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
ActiveWindow.ActivePane.VerticalPercentScrolled = 0
End Sub
Sub reemplazar123()
'
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Sub unificacion()
'
'
Application.Run MacroName:="reemplazoA"
Application.Run MacroName:="reemplazarB"
End Sub
Sub FIRMA1()
'
'
'
Selection.InlineShapes.AddPicture FileName:= _
"C:\Users\hernan.suarez\Pictures\firma OAJ.png", _
LinkToFile:=False, SaveWithDocument:=True
End Sub
Sub CENTRAR()
'
'
'
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
End Sub
Sub FIRMA_UNIFI()
'
'
'
Application.Run MacroName:="FIRMA1"
Application.Run MacroName:="CENTRAR"
Application.Run MacroName:="res"
Application.Run MacroName:="reemplazar_RES"
End Sub
Sub reemplazar_RES()
'
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
With Selection.Find
.Text = "Res_MAR"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Sub res()
'
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "Res_MAR"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Sub a_formato_firma_UNIFI()
'
'
'
Application.Run MacroName:="unificacion"
Application.Run MacroName:="fecha1"
Application.Run MacroName:="fecha"
Application.Run MacroName:="FIRMA_UNIFI"
End Sub
Sub fecha()
'
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "Fecha_MAR"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Sub fecha1()
'
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Sub firma_masiva()
'
'
'
Application.Run MacroName:="FIRMA1"
ActiveDocument.AcceptAllRevisions
Application.Run MacroName:="CENTRAR"
ActiveDocument.AcceptAllRevisions
End Sub
Sub masivo1()
'
'
'
Application.Run MacroName:="firma_masiva"
ActiveDocument.AcceptAllRevisions
End Sub
Sub a_formato_firma_UNIFI1()
'
'
'
Application.Run MacroName:="busca_firma"
Application.Run MacroName:="unificacion"
Application.Run MacroName:="fecha1"
Application.Run MacroName:="CENTRAR"
Application.Run MacroName:="fecha"
Application.Run MacroName:="FIRMA_UNIFI"
Application.Run MacroName:="fecha23"
End Sub
Sub fecha23()
'
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
With Selection.Find
.Text = "Fecha_MAR"
.Execute Replace:=wdReplaceAll
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Sub busca_F()
'
'
'
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Firma_MAR"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.InlineShapes.AddPicture FileName:= _
SaveWithDocument:=True
End Sub
Sub a_formato_firma_UNIFI_final()
'
'
'
Application.Run MacroName:="busca_F"
Application.Run MacroName:="fecha"
Application.Run MacroName:="res"
Application.Run MacroName:="reemplazar_RES"
Application.Run MacroName:="fecha23"
End Sub
Sub a_formato_firma_res_fecha_final()
'
'
'
Application.Run MacroName:="busca_F"
Application.Run MacroName:="fecha"
Application.Run MacroName:="res"
Application.Run MacroName:="reemplazar_RES"
Application.Run MacroName:="fecha23"
End Sub
Sub proceso_final()
'
'
'
With Selection.Find
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
With Selection
.Collapse Direction:=wdCollapseStart
Else
.Collapse Direction:=wdCollapseEnd
End If
.Find.Execute Replace:=wdReplaceOne
.Collapse Direction:=wdCollapseEnd
Else
.Collapse Direction:=wdCollapseStart
End If
.Find.Execute
End With
With Selection.Find
.Text = "NUMERO_RESOLUCION_OAJ"
.Replacement.Text = "Res_MAR"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
With Selection
.Collapse Direction:=wdCollapseStart
Else
.Collapse Direction:=wdCollapseEnd
End If
.Find.Execute Replace:=wdReplaceOne
.Collapse Direction:=wdCollapseEnd
Else
.Collapse Direction:=wdCollapseStart
End If
.Find.Execute
End With
With Selection.Find
.Text = _
.Replacement.Text = "Fecha_MAR"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
With Selection
Else
.Collapse Direction:=wdCollapseEnd
End If
.Find.Execute Replace:=wdReplaceOne
.Collapse Direction:=wdCollapseEnd
Else
.Collapse Direction:=wdCollapseStart
End If
.Find.Execute
End With
End Sub
Sub a11()
'
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
ActiveWindow.ActivePane.VerticalPercentScrolled = 0
ActiveWindow.Panes(2).Close
End If
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub
Sub aa_1()
'
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Replacement.Text = _
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
ActiveWindow.ActivePane.VerticalPercentScrolled = 0
ActiveWindow.Panes(2).Close
End If
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "Resolución N° del "
.Replacement.Text = _
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Sub COMBINACION()
'
Application.DisplayAlerts = False
Dim i As Integer
For i = 0 To ActiveDocument.MailMerge.DataSource.RecordCount
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = ActiveDocument.MailMerge.DataSource.ActiveRecord
.LastRecord = ActiveDocument.MailMerge.DataSource.ActiveRecord
End With
.Execute Pause:=False
End With
Selection.Copy
'MsgBox (Selection.Text + ".doc")'
SaveAsAOCELetter:=False
ActiveDocument.Close
'MsgBox ("")'
ActiveDocument.MailMerge.DataSource.ActiveRecord = wdNextRecord
Next
End Sub
With Dialogs(wdDialogCopyFile)
Else
MsgBox "Cancelado"
Exit Sub
End If
End With
Documents.Close Savechanges:=wdPromptToSaveChanges
End If
PrimerLazo = True
End If
MsgBox "Cancelado"
Exit Sub
End If
GoTo Tryagain
MsgBox "Cancelado"
Exit Sub
End If
End If
PrimerLazo = False
End If
HacerlaValida
Do
Next
myDoc.Close Savechanges:=wdSaveChanges
myFile = Dir$()
Wend
End Sub
With rango.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = strSearch
.Replacement.Text = strReplace
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.Execute Replace:=wdReplaceAll
End With
Loop
End Sub
lngJunk = ActiveDocument.Sections(1).Headers(1).Range.StoryType
End Sub
Trayectoria = .Directory
Else
MsgBox "Cancelado"
Exit Sub
End If
End With
Documents.Close Savechanges:=wdPromptToSaveChanges
End If
PrimerLazo = True
End If
HacerlaValida
Do
SaveAsPdf
Next
myDoc.Close Savechanges:=wdSaveChanges
myFile = Dir$()
Wend
End Sub
With rango.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = strSearch
.Replacement.Text = strReplace
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.Execute Replace:=wdReplaceAll
End With
Loop
End Sub
lngJunk = ActiveDocument.Sections(1).Headers(1).Range.StoryType
End Sub
End If
End Sub
Sub reemplazoA()
'
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
ActiveWindow.ActivePane.VerticalPercentScrolled = 0
End Sub
Sub reemplazarB()
'
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Sub unificacionA()
'
'
Application.Run MacroName:="reemplazoA"
Application.Run MacroName:="reemplazarB"
End Sub
Sub reemplazar_RES()
'
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
With Selection.Find
.Text = "Res_MAR"
.Execute Replace:=wdReplaceAll
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Sub res()
'
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "Res_MAR"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Sub a_formato_firma_UNIFI_A()
'
'
'
Application.Run MacroName:="unificacionA"
Application.Run MacroName:="fechaA"
Application.Run MacroName:="fechaB"
End Sub
Sub fechaB()
'
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "Fecha_MAR"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Sub fechaA()
'
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Sub fechaC()
'
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
With Selection.Find
.Text = "Fecha_MAR"
.Execute Replace:=wdReplaceAll
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub