Results 1 to 5 of 5

Email sending macro

Threaded View

saurabhlotankar Email sending macro 02-28-2013, 11:56 PM
xlbiznes Re: Email sending macro 03-01-2013, 05:50 AM
saurabhlotankar Re: Email sending macro 03-03-2013, 10:50 PM
xlbiznes Re: Email sending macro 03-04-2013, 01:58 AM
saurabhlotankar Re: Email sending macro 06-18-2013, 04:37 AM
  1. #1
    Registered User
    Join Date
    12-19-2010
    Location
    mumbai, India
    MS-Off Ver
    Excel 2003
    Posts
    71

    Email sending macro

    Hello,
    I have created a macro to send mails form outlook. All code is working properly. I jast want to know how to do formating of the signature in the mail. i wana make my name bold in the signature. Can anyone help me?

    This is the code:
    Sub ReadExcel()
     
     
        Dim OutApp As Object
        Dim fLoc As String
        Dim cell As Range, rng As Range
        Dim vFile As Variant, vFiles As Variant
        Dim Signature As String
    
    
     
     
        'Range of cells with recipeant info
        'Column A is attaachment filenames (multiple filenames separated by ; e.g File1.xls;File2.xls
        'Column B is the email address
        'Column C is the File path for the attachment files
        'Column D id the body of the mail
        
    
        With ThisWorkbook.ActiveSheet
            Set rng = .Range("A2", .Range("A" & Rows.Count).End(xlUp))
        End With
       
        Set OutApp = CreateObject("Outlook.Application")
       
        ' Read in the data and create a new message with attachment for each Excel entry
        For Each cell In rng
       
            'File path in column C
            fLoc = cell.Offset(, 2).Value
            If Right(fLoc, 1) <> "\" Then fLoc = fLoc & "\"
           
            'Create a new Email for each recpient
            With OutApp.CreateItem(0)
                'Recipient
                .Recipients.Add cell.Offset(, 1).Value
               
                'Attach each file
                vFiles = Split(cell.Value, ";")
                For Each vFile In vFiles
                    If Len(Dir(fLoc & vFile)) Then
                        .Attachments.Add fLoc & vFile
                    Else
                        AppActivate ThisWorkbook.Parent
                        MsgBox "Could not locate file: " & vbCr & fLoc & vFile, , "File Not Found"
                    End If
                Next vFile
               
                .Display
                 .Subject = "Weekly Sales Report"
                 .Body = Sheets("sheet1").Cells(2, 4).Value
                 
    
                 
                          
                 .Send
            End With
        Next cell
       
    End Sub
    Last edited by Leith Ross; 03-01-2013 at 01:33 AM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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