Skip to content

Instantly share code, notes, and snippets.

@mgeeky
Created August 30, 2017 18:21
Show Gist options
  • Save mgeeky/9cb6acdec31c8a70cc037c84c77a359c to your computer and use it in GitHub Desktop.
Save mgeeky/9cb6acdec31c8a70cc037c84c77a359c to your computer and use it in GitHub Desktop.
VBA Macro function to be used as a Social Engineering trick removing "Enable Content" warning message as the topmost floating text box with given name.
Private Sub DeleteWarningPicture(ByVal textBoxName As String, ByVal saveDocAfter As Boolean)
Dim shape As Word.shape
For Each shape In ActiveDocument.Shapes
If StrComp(shape.Name, textBoxName) = 0 Then
shape.Delete
Exit For
End If
Next
If saveDocAfter Then
ActiveDocument.Save
End If
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment