+ Reply to Thread
Results 1 to 2 of 2

Add Hyperlink to incoming plaintext messages

Hybrid View

  1. #1
    Registered User
    Join Date
    07-24-2014
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    2

    Add Hyperlink to incoming plaintext messages

    Hi - I receive email regularly from an internal application any time a ticket is updated. Within the email there is always a link address to reach the ticket, but the link is plaintext and certainly not clickable.

    I would like to write a VBA Script to make this a clickable link. I'm not really sure how to do any of this, but I think the psuedocode would be something like.
    Convert to non-plaintext
    Save
    Find url to hyperlink
    Read url
    Replace plain url with hyperlink to url
    Save
    Does anyone have any examples I could piece this together from?

    Thanks much!

  2. #2
    Forum Contributor
    Join Date
    08-27-2006
    Posts
    136

    Re: Add Hyperlink to incoming plaintext messages

    With this you can get find and open the url without converting the original mail, which might be sufficient for your needs.

    Sub LaunchURL(itm As MailItem)
    
        Dim bodyString As String
        Dim bodyStringSplitLine
        Dim bodyStringSplitWord
        Dim splitLine
        Dim splitWord
    
        bodyString = itm.Body
        bodyStringSplitLine = Split(bodyString, vbCrLf)
    
        For Each splitLine In bodyStringSplitLine
            bodyStringSplitWord = Split(splitLine, " ")
    
            For Each splitWord In bodyStringSplitWord
                If Left(splitWord, 7) = "http://" Then
                    Shell ("C:\Program Files\Internet Explorer\IEXPLORE.EXE" & " " & splitWord)
                End If
            Next
    
        Next
    
        Set itm = Nothing
    
    End Sub
    
    Private Sub test()
        Dim currItem As MailItem
        Set currItem = ActiveInspector.currentItem
        LaunchURL currItem
    End Sub
    To mark "Solved" go to Thread Tools.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Neckbeard Engineer, incoming
    By farfennugen in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 04-07-2014, 09:04 PM
  2. Macro from incoming files
    By RMGraham in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2012, 04:16 PM
  3. Incoming/Outgoing Chart
    By krie2509 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 03-09-2010, 12:09 PM
  4. Capture Incoming Net Send Messages
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-29-2008, 04:09 AM
  5. lookup with offset?-NAME Incoming
    By GEORGIA in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1