• Subject: Re: Outlook Macro VBA
  • Author: Sue Mosher [MVP]
  • Date: 05 Jan 2010
  • References: 1
Outlook version? FYI, objSel is a Selection object, not a string, so it would be better to write: objIEApp.Navigate "http://support.ticket.com?ticid=" & objSel.Text
Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54
<Onno de Vries> wrote in message news:20101553628onno.prive@famdevries.org...
> I've created a macro that should enable me to select part of a text from a > received email, paste that text to the macro, then that macro will launch > IE with a full URL with that selected text. > e.g. selected is '2804837', the URL in the macro is > "http://www.whatever.com?ticid=". IE will be launched with that URL but > added to that is the selected text to have a full URL pointing me to the > exact page. > See code: > Sub View_Support_Ticket() > > Dim objOL As Application > Dim objDoc As Object > Dim objSel As Object > Dim objIEApp As SHDocVw.InternetExplorer > Dim dummy As String > > Set objOL = Application > Set objDoc = objOL.ActiveInspector.WordEditor > Set objSel = objDoc.Windows(1).Selection > Set objIEApp = CreateObject("InternetExplorer.Application") > > objIEApp.Navigate "http://support.ticket.com?ticid=" & objSel > objIEApp.Visible = True > > Set objIEApp = Nothing > > End Sub > > The problem is that when I select the text in an opened email item (double > clik on the email message) and lauch the macro I get an error message pop > up: "Sub or Function not defined". However, when I launch the macro from > the MS visual basic editor, it runs perfectly... > > What am I doing wrong here? Quite a newbe on this btw...
05 Jan 2010Outlook Macro VBA.Onno de Vries
05 Jan 2010\ Re: Outlook Macro VBA.Sue Mosher [MVP]
Contact Us
All times are in (US) Eastern Daylight Time (GMT -4:00)