Más contenido relacionado
La actualidad más candente (20)
Similar a Macros en Word (20)
Macros en Word
- 3. En este primer macro ingresaras este código:
Sub macro1()
MsgBox "Bienvenidos"
End Sub
- 5. En el siguiente macro, mostraremos una combinación
de teclado, el cual la pc guardara para cambio que
agás agregando un código.
- 6. Sub Macro1()
'
' Macro1 Macro
'
'
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=8, NumColumns:= _
10, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
wdAutoFitFixed
With Selection.Tables(1)
If .Style <> "Tabla con cuadrícula" Then
.Style = "Tabla con cuadrícula"
End If
.ApplyStyleHeadingRows = True
.ApplyStyleLastRow = False
.ApplyStyleFirstColumn = True
.ApplyStyleLastColumn = False
.ApplyStyleRowBands = True
.ApplyStyleColumnBands = False
End With
Selection.MoveRight Unit:=wdCharacter, Count:=10, Extend:=wdExtend
Selection.Tables(1).Style = "Cuadrícula clara - Énfasis 2"
Selection.Cells.Merge
Selection.TypeText Text:="registros 2015"
- 7. Selection.MoveLeft Unit:=wdCharacter, Count:=14, Extend:=wdExtend
Selection.SelectCell
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=4
Selection.TypeText Text:="campo 1"
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeText Text:="campo"
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.TypeText Text:=" 2"
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeText Text:="campo 3"
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeText Text:="campo 4"
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeText Text:="campo 5"
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeText Text:="campo 6"
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeText Text:="campo 7"
End Sub