i came across this code on google:
Sub RemoveAllHyperlinksinanEmail()
Dim objMail As Outlook.MailItem
Dim objInspector As Outlook.Inspector
Dim objDocument As Word.Document
Dim objHyperlinks As Word.Hyperlinks
Dim objHyperlink As Word.Hyperlink
Dim strPrompt As String
Dim nResponse As Integer
Set objMail = Application.ActiveInspector.CurrentItem
Set objInspector = objMail.GetInspector
Set objDocument = objInspector.WordEditor
Set objHyperlinks = objDocument.Hyperlinks
On Error Resume Next
If objHyperlinks.Count > 0 Then
strPrompt = "Are you sure to remove all the hyperlinks in this email?"
nResponse = MsgBox(strPrompt, vbYesNo + vbQuestion, "Remove All Hyperlinks")
If nResponse = vbYes Then
While objHyperlinks.Count > 0
objHyperlinks(1).Delete
Wend
objMail.Save
End If
End If
End Sub
i get compile error: user-defined type not defined for this line:
Dim objDocument As Word.Document
any ideas?
Bookmarks