View full version

Word te va a sorprender! Formatea tus publicaciones mediante MACROS | TUTORIAL #HTML #MarkDown


•Partes del video:

•Introducción: 00:00

•Cómo grabar Macros en Word: 02:40

•Ingresar al Visual Basic a ver y editar códigos: 03:40

•Cómo asignar Macro a botón y agregar botón a la barra de herramientas: 05:00

•Editando código de la Macro para mejorarlo: 07:45

•Cómo crear Macro para formateo de imágenes: 09:15

•Cómo crear Macro para formateo del texto escrito (justificado, centrado, etc.): 11:50

•Personalizando interfaz de Word (botones): 13:10

•Palabras finales: 14:30

•Publicaciones escritas anteriores: 15:25


Microsoft Word te puede sorprender. No necesitas saber de programación para poder hacer esto. Solo con introducir los comandos que necesites, ya sea en HTML o MarkDown, Word puede grabar por ti las macros necesarias, es decir, los códigos en el Visual Basic, y solo con un poco de intuición podrás modificarlas según tu conveniencia.

A diferencia de los editores de Hive.blog y PeakD.com, Microsoft Word te ofrece bastante dinamismo a la hora de redactar y formatear tu publicación. Eso sí, depende de ti saber usar y aprovechar al máximo las herramientas de Word, no te ofrece todo automáticamente.

Aunque puede que a veces no sea tan necesario, todos en #Hive sabemos la importancia del formateo, sin él nuestras publicaciones no tendrían el aspecto visual que desearíamos. Tanto si eres nuevo usuario o no, esta publicación puede servirte de ayuda.

Y es que no importa si eres nuevo o no en Hive, es probable que todos alguna vez en la vida hayamos utilizado o abierto Microsoft Word.

Si eres de los que les cuesta entender cómo usar los códigos para el formateo, quizás esta publicación te ayude a aprender cómo introducirlos automáticamente en Word. Si bien los editores de los diferentes front-ends (como hive.blog y peakd.com) ya poseen algunas herramientas básicas, otras más avanzadas como la doble columna y texto rojo requieren una introducción manual aparte.

También puedes visitar mi video anterior acerca de Microsoft Word y Hive, el cual hacía referencia a Tips para tu contenido escrito, y las ventajas de Word cómo alternativa a los editores de la plataforma para redactar tus publicaciones:

Post escrito

Hace casi 2 años realicé 3 publicaciones relacionadas al formateo mediante Word (enlaces abajo). Este video de #3Speak vendría a actualizar y agregar Tips útiles para no solo formatear sino para saber cómo agregar dichas Macros a botones en tu interfaz de Word, para tenerlos a la vista cuando los necesites.


Usando las macros de Microsoft Word (Visual Basic) para formatear

Formateo de texto (justificado/centrado) mediante macros de Word y VB

Microsoft Word Macros (Visual Basic) — Formateo de imágenes en Hive

Códigos de VisualBasic para las Macros (HTML):

Solo copia y pegar lo siguiente en Visual Basic (Microsoft Word objetos-ThisDocument). Puedes acceder a VisualBasic mediante ALT+F11 en Word:

Sub LETRAROJA()    If Selection.Range = Empty Then    Selection.TypeText Text:="
"
Selection.MoveLeft Unit:=wdCharacter, Count:=6Else x = Selection.Text Selection.TypeText Text:="
" & x & "" Selection.MoveLeft Unit:=wdCharacter, Count:=6 End If End SubSub NEGRITA()If Selection.Range = Empty Then Selection.TypeText Text:="" Selection.MoveLeft Unit:=wdCharacter, Count:=4Else x = Selection.Text Selection.TypeText Text:="" & x & "" Selection.MoveLeft Unit:=wdCharacter, Count:=4 End If End SubSub CURSIVA()'' Cursiva Macro'If Selection.Range = Empty Then Selection.TypeText Text:="" Selection.MoveLeft Unit:=wdCharacter, Count:=4Else x = Selection.Text Selection.TypeText Text:="" & x & "" Selection.MoveLeft Unit:=wdCharacter, Count:=4 End IfEnd SubSub SUBTITULO()'If Selection.Range = Empty Then Selection.TypeText Text:="" Selection.MoveLeft Unit:=wdCharacter, Count:=6Else x = Selection.Text Selection.TypeText Text:="" & x & "" Selection.MoveLeft Unit:=wdCharacter, Count:=6 End IfEnd SubSub SUPERINDICE()'If Selection.Range = Empty Then Selection.TypeText Text:="" Selection.MoveLeft Unit:=wdCharacter, Count:=6Else x = Selection.Text Selection.TypeText Text:="" & x & "" Selection.MoveLeft Unit:=wdCharacter, Count:=6 End IfEnd SubSub VIÑETA()If Selection.Range = Empty Then Selection.TypeText Text:="
  • " Selection.MoveLeft Unit:=wdCharacter, Count:=5Else x = Selection.Text Selection.TypeText Text:="
  • " & x & "
  • " Selection.MoveLeft Unit:=wdCharacter, Count:=5 End IfEnd SubSub LINKS()'
    ' Links Macro'' Selection.TypeText Text:="[]()" Selection.MoveLeft Unit:=wdCharacter, Count:=3 End SubSub CentrarTexto()'' CentrarTexto Macro''If Selection.Range = Empty Then Selection.TypeText Text:="
    " Selection.MoveLeft Unit:=wdCharacter, Count:=9Else x = Selection.Text Selection.TypeText Text:="
    " & x & "
    " Selection.MoveLeft Unit:=wdCharacter, Count:=9 End If End SubSub Citas()'
    ' Citas Macro''If Selection.Range = Empty Then Selection.TypeText Text:="
    " Selection.MoveLeft Unit:=wdCharacter, Count:=13Else x = Selection.Text Selection.TypeText Text:="
    " & x & "
    " Selection.MoveLeft Unit:=wdCharacter, Count:=13 End IfEnd SubSub insertarimagen()'
    ' insertarimagen Macro'' Selection.Font.Bold = True Selection.Font.Color = wdColorRed Selection.TypeText Text:="
    " Selection.Font.Color = wdColorSkyBlue Selection.TypeText Text:=" URL " Selection.Font.Color = wdColorRed Selection.TypeText Text:="
    " Selection.Font.Color = wdColorGreen Selection.TypeText Text:=" []() " Selection.Font.Color = wdColorRed Selection.TypeText Text:="
    " Selection.Font.Color = wdColorAutomatic Selection.Font.Bold = False Selection.TypeParagraph End SubSub titulo1()'
    ' titulo1 Macro''If Selection.Range = Empty Then Selection.TypeText Text:="

    " Selection.MoveLeft Unit:=wdCharacter, Count:=5Else x = Selection.Text Selection.TypeText Text:="

    " & x & "

    " Selection.MoveLeft Unit:=wdCharacter, Count:=5 End IfEnd SubSub titulo2()'
    ' titulo1 Macro''If Selection.Range = Empty Then Selection.TypeText Text:="

    " Selection.MoveLeft Unit:=wdCharacter, Count:=5Else x = Selection.Text Selection.TypeText Text:="

    " & x & "

    " Selection.MoveLeft Unit:=wdCharacter, Count:=5 End IfEnd SubSub titulo3()'
    ' titulo1 Macro''If Selection.Range = Empty Then Selection.TypeText Text:="

    " Selection.MoveLeft Unit:=wdCharacter, Count:=5Else x = Selection.Text Selection.TypeText Text:="

    " & x & "

    " Selection.MoveLeft Unit:=wdCharacter, Count:=5 End IfEnd SubSub titulo4()'
    ' titulo1 Macro''If Selection.Range = Empty Then Selection.TypeText Text:="

    " Selection.MoveLeft Unit:=wdCharacter, Count:=5Else x = Selection.Text Selection.TypeText Text:="

    " & x & "

    " Selection.MoveLeft Unit:=wdCharacter, Count:=5 End IfEnd SubSub titulo5()'
    ' titulo1 Macro''If Selection.Range = Empty Then Selection.TypeText Text:="
    " Selection.MoveLeft Unit:=wdCharacter, Count:=5Else x = Selection.Text Selection.TypeText Text:="
    " & x & "
    " Selection.MoveLeft Unit:=wdCharacter, Count:=5 End IfEnd SubSub titulo6()'
    ' titulo1 Macro''If Selection.Range = Empty Then Selection.TypeText Text:="
    " Selection.MoveLeft Unit:=wdCharacter, Count:=5Else x = Selection.Text Selection.TypeText Text:="
    " & x & "
    " Selection.MoveLeft Unit:=wdCharacter, Count:=5 End IfEnd SubSub bloquecodigo()'
    ''If Selection.Range = Empty Then Selection.TypeText Text:="``````" Selection.MoveLeft Unit:=wdCharacter, Count:=3Else x = Selection.Text Selection.TypeText Text:="```" & x & "```" Selection.MoveLeft Unit:=wdCharacter, Count:=3 End IfEnd SubSub tachado()If Selection.Range = Empty Then Selection.TypeText Text:="" Selection.MoveLeft Unit:=wdCharacter, Count:=9Else x = Selection.Text Selection.TypeText Text:="" & x & "" Selection.MoveLeft Unit:=wdCharacter, Count:=9 End IfEnd SubSub preformateado()If Selection.Range = Empty Then Selection.TypeText Text:="
    "    Selection.MoveLeft Unit:=wdCharacter, Count:=6Else    x = Selection.Text    Selection.TypeText Text:="
    " & x & ""    Selection.MoveLeft Unit:=wdCharacter, Count:=6    End IfEnd SubSub fuentecodigo()If Selection.Range = Empty Then    Selection.TypeText Text:=""    Selection.MoveLeft Unit:=wdCharacter, Count:=7Else    x = Selection.Text    Selection.TypeText Text:="" & x & ""    Selection.MoveLeft Unit:=wdCharacter, Count:=7    End IfEnd SubSub alineacionderecha()If Selection.Range = Empty Then    Selection.TypeText Text:="
    "
    Selection.MoveLeft Unit:=wdCharacter, Count:=6Else x = Selection.Text Selection.TypeText Text:="
    " & x & "" Selection.MoveLeft Unit:=wdCharacter, Count:=6 End IfEnd SubSub doblecolumna()'''' Selection.Font.Bold = True Selection.Font.Color = wdColorRed Selection.TypeText Text:="
    " Selection.Font.Bold = wdToggle Selection.Font.Color = wdColorBlack Selection.TypeText Text:=" TEXTO IZQ " Selection.Font.Bold = wdToggle Selection.Font.Color = wdColorRed Selection.TypeText Text:="" Selection.TypeParagraph Selection.Font.Bold = wdToggle Selection.Font.Color = wdColorRed Selection.Font.Bold = wdToggle Selection.TypeText Text:="
    " Selection.Font.Bold = wdToggle Selection.Font.Color = wdColorBlack Selection.TypeText Text:=" TEXTO DER " Selection.Font.Bold = wdToggle Selection.Font.Color = wdColorRed Selection.TypeText Text:="" Selection.TypeParagraph Selection.TypeParagraph Selection.TypeText Text:="---" Selection.Font.Bold = False Selection.Font.Color = wdColorBlack Selection.TypeParagraph Selection.Font.Bold = False Selection.Font.Color = wdColorBlack End SubSub tabla() Selection.Font.Bold = False Selection.Font.Color = wdColorBlack Selection.TypeText Text:="TÍTULO 1" Selection.Font.Bold = wdToggle Selection.Font.Color = wdColorRed Selection.TypeText Text:=" | " Selection.Font.Bold = wdToggle Selection.Font.Color = wdColorBlack Selection.TypeText Text:="TÍTULO 2" Selection.TypeParagraph Selection.Font.Color = wdColorRed Selection.Font.Bold = wdToggle Selection.TypeText Text:="-|-" Selection.TypeParagraph Selection.Font.Color = wdColorBlack Selection.Font.Bold = wdToggle Selection.TypeText Text:="CONTENIDO 1" Selection.Font.Bold = wdToggle Selection.Font.Color = wdColorRed Selection.TypeText Text:=" | " Selection.Font.Bold = wdToggle Selection.Font.Color = wdColorBlack Selection.TypeText Text:="CONTENIDO 2" Selection.TypeParagraphEnd Sub

    Códigos de VisualBasic para las Macros (MarkDown):

    Hay pocas variaciones respecto al código anterior, solo debes sustituir:

    <b></b> por **** para Letra Negrita.<i></i> por ** para letra cursiva.<blockquote></blockquote> por > para las citas.<strike></strike> por ~~~~ para las letras tachadas.<h1></h1> por # para los títulos (1, 2, 3, etc).Cambiar el número Count:=

    Deja tu comentario o comparte (reblog) esta publicación si te ha parecido interesante.
    Leave a comment or share (reblog) this post if you found it interesting.

    Música 1: Midnight - E-Piano Lounge & Chill Music (de JuliusH) - Pixabay

    Música 2: Cali (de ItsWatR) - Pixabay

    Música 3: Christmas Chill lofi Lounge Background Music for Videos (de Lesfm) - Pixabay

    ¡Gracias por visitar! — Deja tu comentario

    ▶️ 3Speak