miércoles, 12 de octubre de 2016

Remover todos los hiperlinks y los alternative text en word



Remove all hyperlinks with VBA in word

You can use the following VBA to remove all hyperlinks in Word.
1. Press “Alt-F11” to open the Microsoft Visual Basic for Application window;
2. Click Insert > Module, and then copy and paste the follow VBA code into the Module window.
3. Then click Run Sub button to run the script.
VBA Code 1: Remove all hyperlinks of current document
Sub KillTheHyperlinks()
' -----------------------------------------------
' Removes all hyperlinks from the document:
' Text to display is left intact
' -----------------------------------------------
With ThisDocument
' Loop while there are hyperlinks afoot!
While .Hyperlinks.Count > 0
.Hyperlinks(1).Delete
Wend
End With
' Shut this off, don't need anymore popping up
Application.Options.AutoFormatAsYouTypeReplaceHyperlinks = False
End Sub



Otra Rutina
Sub Quitahiper()
Dim i
Do While ActiveDocument.Hyperlinks.Count > 0
For Each i In ActiveDocument.Hyperlinks
i.Delete
Next i
Loop
End Sub


Remove all Alternative Text in word



Sub RemoveAltText()

For Each iShape In ActiveDocument.InlineShapes
iShape.AlternativeText = ""
Next iShape

For Each Shape In ActiveDocument.Shapes
Shape.AlternativeText = ""
Next Shape

End Sub

No hay comentarios:

Publicar un comentario