+ Reply to Thread
Results 1 to 1 of 1

Email selecting in Outlook

Hybrid View

colinmstone Email selecting in Outlook 02-27-2013, 09:18 AM
  1. #1
    Registered User
    Join Date
    02-19-2013
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6

    Email selecting in Outlook

    Hello All,
    I have copied this and made it work for my use but can't seem to select a different email in outlook to send from. I have created a new profile in outlook and even forced outlook to use only this profile but the macro still seems to tag my Exchange Email address. Can someone look at this coding and edit were it would work. I would like to get this working and I'm too new to V Basic to know where to go from here.
    Sub Button1_Click()
     Dim OutApp As Object
        Dim OutMail As Object
        Dim cell As Range
        Dim strbody As String
    
        Application.ScreenUpdating = False
        Set OutApp = CreateObject("Outlook.Application")
    
        On Error GoTo cleanup
        For Each cell In Columns("e").Cells.SpecialCells(xlCellTypeConstants)
            If cell.Value Like "?*@?*.?*" And _
               UCase(Cells(cell.Row, "f").Value) = "YES" Then
                Set OutMail = OutApp.CreateItem(0)
                On Error Resume Next
                With OutMail
                    .Bcc = cell.Value
                    .Subject = "Over Limit"
                    .htmlbody = "<b>" & "<font face=""Courier New"" size=""2"" color=""black"">" & "<br/>" & vbLf & _
                    "<b>" & "<font face=""Courier New"" size=""2"" color=""black"">" & "XXXXXXX," & "<br/>" & [a3] & "<br/>" & "XXXXXXX" & "</b>" & _
                    "<br/>" & "<b>" & "<font face=""Courier New"" size=""2"" color=""black"">" & "XXXXXXXXXXX" & "</b>" & "<br/>" & "will be turned down to 128KB up and down." & _
                    "<br/>" & "<b>" & "XXXXXXXXXX" & "</b>" & "<br/>" & "XXXXXXXXXXXX" & _
                    "<br/>" & "<br/>" & "<br/>" & "<b>" & "<font face=""Courier New"" size=""2"" color=""black"">" & _
                    "Tel: 519-358-4638" & "<br/>" & "Fax: 519-352-2095" & _
                    "<br/>" & "e-mail:" & "<font face=""Courier New"" size=""2"" color=""blue"">" & "XXXXX@XXXXXXX.com" & "<br/>" & _
                    "<font face=""Courier New"" size=""2"" color=""black"">" & "Website:" & _
                    "<font face=""Courier New"" size=""2"" color=""blue"">" & "www.XXXXXX.com" & "</html>" & _
                    .Display  'change to "send" when not in TEST mode
                    
                End With
                On Error GoTo 0
                Set OutMail = Nothing
            End If
        Next cell
    
    cleanup:
        Set OutApp = Nothing
        Application.ScreenUpdating = True
    
    End Sub
    Last edited by arlu1201; 02-27-2013 at 11:46 AM. Reason: Use code tags in future.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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