Hi Noorain, I am using Micorsoft Outlook 2007. Where can I find object library? Secondly I want sender name to automatically displayed as per email received.
Regards, Kaushik Savla On Mon, Dec 12, 2011 at 8:28 PM, NOORAIN ANSARI <noorain.ans...@gmail.com>wrote: > Dear Salva, > > First select *Tools-Reference-Microsoft Outlook 12.0 Object Liberary* > > Please use below code > > Sub outlook_mail() > > Dim olapp As Outlook.Application > Dim olitem As MailItem > Set olapp = New Outlook.Application > Set olitem = olapp.CreateItem(olmailitem) > With olitem > .To = "noorain.ans...@gmail.com" > .CC = "noorain.ans...@gmail.com" > .Subject = "tax advise" > .Body = "Hi Sender(as per email)," & VBA.Chr(10) & VBA.Chr(10) & "As > requested, please find attached below payslip showing tax payable." & > VBA.Chr(10) & VBA.Chr(10) & "Kindly let me know in case you require further > information" & VBA.Chr(10) & VBA.Chr(10) & "Best Regards," & VBA.Chr(10) & > "Kaushik Savla - Assistant Manager" & VBA.Chr(10) & "JLT India Pvt Ltd" > .Send > End With > Set olitem = Nothing > End Sub > > > On Mon, Dec 12, 2011 at 7:31 PM, KAUSHIK SAVLA <savla.kaus...@gmail.com>wrote: > >> Hi Noorain, >> >> Many thanks for the response. >> >> I tried but it is not working. >> >> Further I don't want any excel spreadsheet to be used. I just want to use >> only Outlook. >> >> Please suggest. >> >> Regards, >> Kaushik Savla >> >> -- >> FORUM RULES (934+ members already BANNED for violation) >> >> 1) Use concise, accurate thread titles. Poor thread titles, like Please >> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice >> will not get quick attention or may not be answered. >> >> 2) Don't post a question in the thread of another member. >> >> 3) Don't post questions regarding breaking or bypassing any security >> measure. >> >> 4) Acknowledge the responses you receive, good or bad. >> >> 5) Cross-promotion of, or links to, forums competitive to this forum in >> signatures are prohibited. >> >> NOTE : Don't ever post personal or confidential data in a workbook. Forum >> owners and members are not responsible for any loss. >> >> >> ------------------------------------------------------------------------------------------------------ >> To post to this group, send email to excel-macros@googlegroups.com >> > > > > -- > Thanks & regards, > Noorain Ansari > *http://excelmacroworld.blogspot.com/*<http://excelmacroworld.blogspot.com/> > *http://noorain-ansari.blogspot.com/*<http://noorain-ansari.blogspot.com/> > > -- > FORUM RULES (934+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > > > ------------------------------------------------------------------------------------------------------ > To post to this group, send email to excel-macros@googlegroups.com > -- FORUM RULES (934+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. ------------------------------------------------------------------------------------------------------ To post to this group, send email to excel-macros@googlegroups.com