'Run-time error '-2147467259 (80004005)': method 'document' of object 'IWebBrowser2' failed.'
Sub macro()Dim regex Set objOL = CreateObject("Outlook.Application") Set NewMail = objOL.ActiveExplorer.Selection.Item(1) NewMail.Display res = NewMail.Body Set regex = CreateObject("VBScript.RegExp") With regex .Global = False .MultiLine = False .IgnoreCase = True .Pattern = "HYPERLINK ""([^""]+?)""Click here to access enquiry" End With Set mtches = regex.Execute(res) If mtches.Count > 0 Then strHL = mtches(0).submatches(0) Set oIE = New InternetExplorerMedium oIE.navigate strHL, CLng(2048) oIE.Visible = True End IfEnd Sub