Consulting

Results 1 to 12 of 12

Thread: Adding Smilies/Emoticons to emails

  1. #1
    Administrator
    Chat VP
    VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location

    Talking Adding Smilies/Emoticons to emails

    I did a search of this forum & the KB the other day and couldn't believe this question hadn't been asked before ...


    I normally use Outlook Express and give Outlook a miss, however I might be persuaded to use it if there were some simple way to add some custom smilies to my emails.

    What I'm thinking of is an add to the email toolbar of a smiley button so that when composing an email, I click it and a userform pops up with a list (pictures) of my smilies so I only need to click the smiley I want to insert it. (like the smiley thing here when posting {but smaller}).

    Is this do-able?

    Regards,
    John
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  2. #2
    Just A Dude VBAX Tutor Scottie P's Avatar
    Joined
    May 2004
    Location
    Remote from 18901 USA
    Posts
    263
    Location
    Well, I can use Yahoo emoticons in a sig in OL2K so that should be a start... :O
    Life is Visual: Presence is Perception...
    How we see the world is how we respond to it. ~* Peace *~

  3. #3
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Have you checked out GetSmilie from http://www.vbaexpress.com/cooltools.php? You can download a trial version to see if it will work with Outlook Express.

  4. #4
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    John... just to confirm...

    GetSmile DOES work in OE. Why? Because it actually creates a link to THEIR server to get the picture.

    And they have some pretty cool (and very naughty) smilies.
    ~Anne Troy

  5. #5
    Just A Dude VBAX Tutor Scottie P's Avatar
    Joined
    May 2004
    Location
    Remote from 18901 USA
    Posts
    263
    Location
    hmmm, sorry...I got the impression that Johnske wanted to use the smilies in Outlook...not Outlook Express.

    Think I'll head on over to the Kb for a while...

    S
    Life is Visual: Presence is Perception...
    How we see the world is how we respond to it. ~* Peace *~

  6. #6
    Administrator
    Chat VP VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Hi All,

    Had a look at 'GetSmilie' but that's not a freebie...

    Used to have a setup from SmileyCentral in a previous Hard-Drive reincarnation and they were pretty cool (some were very rude also). I've tried to download it again several times lately but the link now appears to be dead.

    Downloaded a setup from SmileyWorld a few days ago but didn't like the smilies they had and it was then a HELL of a job to uninstall it (it didn't like being uninstalled).

    Thought Yahoo was only for Instant Messaging? - I have that for MSN Messenger...

    I had thought this would be do-able in Outlook, not Outlook Express, and also thought that if someone took it on it'd also make a good KB entry

    Regards,
    John
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  7. #7
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    There's no need, John. Smileys will work in OL or OE...no matter. They just need to be links to "live" graphics. The smilies here at vbax link to the smilies in the server folder. You can even use those, you just need to do html format email.
    ~Anne Troy

  8. #8
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    Quote Originally Posted by Dreamboat
    There's no need, John. Smileys will work in OL or OE...no matter. They just need to be links to "live" graphics. The smilies here at vbax link to the smilies in the server folder. You can even use those, you just need to do html format email.
    I thought Jake stopped hotlinking on the server to prevent that?

    John, my mother uses Incredimail with OE, I think. It sends some pretty funky things with backgrounds, smilies, etc...

    May want to do a search for that.
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  9. #9
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    I thought Jake stopped hotlinking on the server to prevent that?
    Well, that's possible. I dunno.
    ~Anne Troy

  10. #10
    VBAX Contributor Ivan F Moala's Avatar
    Joined
    May 2004
    Location
    Auckland New Zealand
    Posts
    185
    Location
    These images are usually just animated gifs. All you really need is a cache of thes on your drive and the below code (which I have amended from my site) to do this from within Excel.....

    This code inserts an image as a signature OR background

    Option Explicit
    
    'To create an HTML message that included an embedded image -- that, instead,
    'all "" <img> "" tags had to use full URLs to public web addresses.
    'The impossible has become possible, though, through the efforts of Outlook MVP Neo,
    'who devised a method that uses undocumented MAPI properties and CDO.
    
    'CDO = Microsoft? Collaboration Data Objects
    'CDO does not represent a new messaging model, but rather an additional scripting interface
    'to the Messaging Application Programming Interface (MAPI) model.
    
    'for more info see;
    'http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdo/html/_olemsg_overview_of_cdo.asp
    
    'For versions see;
    'http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncdsys/html/cdo_roadmap.asp
    
    'In VBA or Visual Basic you will need to add a reference to the CDO 1.21 library to use this procedure.
    'For client applications, you should install Outlook in order to install CDO.
    'In Outlook 2000 and Outlook 2002, CDO is included, but you must explicitly select
    'it during setup.
    
    'Microsoft CDO 1.21 Library
    'MAPI
    'GUID = {3FA7DEA7-6438-101B-ACC1-00AA00423326}
    'Path C:\PROGRA~1\COMMON~1\System\Mapi\1033\NT\CDO.DLL
    'GUID Ref .AddFromGuid "{3FA7DEA7-6438-101B-ACC1-00AA00423326}",1,21
    '.Item("MAPI")
    
    '//
    Const strHTMLCredit1 As String = _
        "<br><br><b><i><FONT SIZE=2> Automation - Emailer by Ivan F Moala 2003"
        
    Const strHTMLCredit2 As String = _
        "<br><A HREF='http://www.xcelfiles.com'>Visit my Site</A></i></b><br><br>"
    '//
    Const CdoPR_ATTACH_MIME_TAG As Long = &H370E001E '&H3712001E
    Const olSave = 0
    
    Sub InsertPictureInEmail_V2()
    '/////////////////////////////////////////
    '// Ivan F Moala 17th March 2003        //
    '// Amendment                           //
    '// Ivan F Moala 30th June 2003         //
    '// Credit to Outlook MVP Neo           //
    '//     Testing under Xl2000 / WinXP    //
    '//     Testing under Xl2003 / WinXP    //
    '/////////////////////////////////////////
    
    '// Dimension variables using Latebinding
    Dim objOutlookApp As Object
    Dim objOutlookMessage As Object
    Dim strHTMLBody As String
    Dim objOutlookAppAttach As Object
    Dim objOutlook_Att As Object
    Dim strEntryID As String
    Dim objSession As Object
    Dim vFileImage As Variant
    
    '// To counter the change in Dir due to MAPI
    Dim strIniFolder As String
    
    '
    Dim blnSignature As Boolean
    
    '// Use late binding      'Reference CDO
    Dim objMsg As Object      'MAPI.Message
    Dim objAttachs As Object  'MAPI.Attachments
    Dim objAttach As Object   'MAPI.Attachment
    Dim colFields As Object   'MAPI.Fields
    Dim oField As Object      'MAPI.Field
    
    '// Sheet
    'Dim objPict As Object
    'Dim MyChart As Chart
    'Dim rgImgSend As Range
    
    '//
    strIniFolder = CurDir
    LoadImg:
    vFileImage = Application.GetOpenFilename("Image Files (*.gif),*.gif")
    If TypeName(vFileImage) = "Boolean" Then Exit Sub
    
    If MsgBox("Insert Signature (Yes) OR Background? (No)", vbYesNo, "aaa") = vbYes Then
        blnSignature = True
    Else
        blnSignature = False
    End If
    
    '// Create an instance of Outlook (or use existing instance if it already exists)
    On Error Resume Next
    Set objOutlookApp = GetObject(, "Outlook.Application")
    
    If Err.Number <> 0 Then
        Set objOutlookApp = CreateObject("Outlook.Application")
        '// We need the Application Open in order to NOT show as attachment
        Shell objOutlookApp, vbMaximizedFocus
    End If
    On Error GoTo 0
    
    '// Create a mail item
    Set objOutlookMessage = objOutlookApp.CreateItem(0)
    Set objOutlookAppAttach = objOutlookMessage.Attachments
    '// add graphic as attachment to Outlook message
    '// change path to graphic as needed
    Set objOutlook_Att = objOutlookAppAttach.Add(vFileImage)
    
    '// Lets save the Msg, this is so that the EntryID property
    '// is set.
    objOutlookMessage.Close olSave
    
    '// Lets get the unique entry ID of the object.
    '// EntryID property corresponds to the MAPI property PR_ENTRYID.
    '// MAPI systems assign a permanent, unique ID string when an object
    '// is created that does not change from one MAPI session to another.
    '// Also, the EntryID changes when an item is moved into another folder.
    strEntryID = objOutlookMessage.EntryID
    
    Set objOutlookMessage = Nothing
    ' *** POSITION CRITICAL *** you must dereference the
    ' attachment objects before changing their properties
    ' via CDO
    Set objOutlookAppAttach = Nothing
    
    '// initialize CDO session
    On Error Resume Next
    Set objSession = CreateObject("MAPI.Session")
    objSession.Logon "", "", False, False
     
    '// get the message created earlier
    Set objMsg = objSession.GetMessage(strEntryID)
    
    '// set properties of the attached graphic that make
    '// it embedded and give it an ID for use in an <IMG> tag
    Set objAttachs = objMsg.Attachments
    Set objAttach = objAttachs.Item(1)
    Set colFields = objAttach.Fields
    
    '// Set oField = oFieldsColl.Add (name, Class [, value] [, PropsetID] )
    Set oField = colFields.Add(CdoPR_ATTACH_MIME_TAG, "image/gif")
    Set oField = colFields.Add(&H3712001E, "MyIdent")
    
    With objMsg
        .Fields.Add "{0820060000000000C000000000000046}0x8514", 11, True
        .Update
    End With
    
    '// Put any HTML you want - this is just an example Signature
    strHTMLBody = "<hr><br>"
    strHTMLBody = strHTMLBody & "<b>Here are the details you were looking for.</b><br>"
    strHTMLBody = strHTMLBody & "<b>Get back to me ASAP</b><br>"
    strHTMLBody = strHTMLBody & "<b>Looking forward to your reply.</b><br><br><br>"
    strHTMLBody = strHTMLBody & "<b><i>Ivan F Moala</i></b><br><br><hr>"
    strHTMLBody = strHTMLBody & "<IMG align=baseline border=0 hspace=0 SRC=cid:MyIdent>" & _
            strHTMLCredit1 & strHTMLCredit2
    
    '// Get the Outlook MailItem again
    Set objOutlookMessage = objOutlookApp.GetNamespace("MAPI").GetItemFromID(strEntryID)
    
    '// add HTML content -- the <IMG> tag
    With objOutlookMessage
        '// Now place HTML code in Body
        .HTMLBody = IIf(blnSignature, strHTMLBody, "<BODY background=cid:MyIdent></BODY>")
        .Display        '// Show it
    End With
    
    '// cleanup
    Set oField = Nothing
    Set colFields = Nothing
    Set objMsg = Nothing
    Set objAttachs = Nothing
    Set objAttach = Nothing
    Set colFields = Nothing
    
    objSession.Logoff
    
    Set objSession = Nothing
    Set objOutlookApp = Nothing
    Set objOutlookMessage = Nothing
    
    ChDir (strIniFolder)
    
    End Sub
    Kind Regards,
    Ivan F Moala From the City of Sails

  11. #11
    Just A Dude VBAX Tutor Scottie P's Avatar
    Joined
    May 2004
    Location
    Remote from 18901 USA
    Posts
    263
    Location
    Johnske, curious...did you get around to trying this out? I haven't as of yet.

    Hi Ivan!! Great to see you round these parts!!

    Scott
    Life is Visual: Presence is Perception...
    How we see the world is how we respond to it. ~* Peace *~

  12. #12
    Administrator
    Chat VP VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Hi Scott, Ivan,

    Scott, yes I have, but I'm getting a runtime error 438 (object doesn't support this property or method) on the line
    vFileImage = Application.GetOpenFilename("Image Files (*.gif),*.gif")

    Ivan, there is a mention about setting a reference to the CDO 1.21 library but I'm unable to find this DLL to set the reference.

    Now, the text in the comments says that In Outlook 2000 and Outlook 2002, CDO is included, but you must explicitly select it during setup. It seems I can't use this cos I'm operating Win97 and Office 2000 (I assume Outlook 2000 is part of Win 2k, not Office 2k (cos I can't find it on my Office disc)).

    Regards,
    John
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

Posting Permissions

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