Integrating excel & outlook

Closed
Lavanya - May 28, 2010 at 06:09 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - May 28, 2010 at 07:21 AM
Hello Team ,

Iam trying to integrate excel macro and outlook .Once i click the macro , the macro should sort the data BU wise . There are 11 tabs for each 6 BU's in one excel workbook .Will you be able to give me a skeleton of the code for me? After the macro sperates the BU ise information it should save it in the name of the BU for which the information was extracted .After that it should get attached to the outlook and also the mailing list should get populated .

Please help .........

Job at stake .
Related:

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
May 28, 2010 at 07:21 AM
Corrected an error

DISCLAIMIER: I HAVE NOT TESTED IT

Some thing like this


Sub ShootANote() 
Dim ObjOutLook As Object 
Dim objMail As Object 
Dim olMailItem As Variant 

Dim SendTo As String 
Dim Subject As String 
Dim Body As String 
Dim CC As String 
Dim Attachment As String 

    Set ObjOutLook = New Outlook.Application 
    Set objMail = ObjOutLook.CreateItem(0) 
     
    SendTo = "Bill.Gate@microsoft.com, SomeOne@SomeWhere.Com" 
    Subject = "Email Works ?" 
    CC = "Yes@No.net" 
    Attachment = "C:\myPornCollection.zip" 
    Body = "Dear Some one" & Chr(13) & vbCrLf & " How is life" 
     
    With objMail 
         
        .To = SendTo 
         
        If (CC <> "") Then .CC = "boss@boss.com" 
         
        .Subject = Subject 
         
        .Body = Body 
         
        if (Attachment <> ") then .Attachments.Add (Attachment) 

        .Display 
    End With 

     
    Set objMail = Nothing 
    Set ObjOutLook = Nothing 

End Sub
0