PC Review


Reply
Thread Tools Rate Thread

How to CC a workbook to a person by VBA

 
 
=?Utf-8?B?RmFyaGFk?=
Guest
Posts: n/a
 
      24th Sep 2007
Hi,

i need to send a workbook to multiple persons and also CC to multiple
persons either in my VBA code.

any helps would be much appriciated.

Thanks,
--
Farhad Hodjat
 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      24th Sep 2007
Hi Farhad

Try the Outlook object model examples from my site
http://www.rondebruin.nl/sendmail.htm

Click on the Tip link on each example page



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Farhad" <(E-Mail Removed)> wrote in message news:3308444E-36B0-4749-89B8-(E-Mail Removed)...
> Hi,
>
> i need to send a workbook to multiple persons and also CC to multiple
> persons either in my VBA code.
>
> any helps would be much appriciated.
>
> Thanks,
> --
> Farhad Hodjat

 
Reply With Quote
 
=?Utf-8?B?RmFyaGFk?=
Guest
Posts: n/a
 
      24th Sep 2007
Thank you Ron,

I put the code:

Dim OutApp As Object
Dim OutMail As Object
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "(E-Mail Removed); (E-Mail Removed)"
.cc = "(E-Mail Removed)"
.Subject = BTNum & "-" & Trim(Str(Range("qty").Value)) & "
Pieces (invoice#" & InvNTxBx.Value & ")"
.Body = "Hi Bruce,This is invoice for today.Thanks &
Regards,Farhad"
.Attachments.Add ("F:\USERS\accounting\EXCEL" &
Trim(Str(Val(Right(InvDTxBx, 4)))) & "\Toshiba\Toshiba " &
Trim(Str(Val(Left(InvDTxBx, 2)))) & "\" & Crtra)
.Display 'Or use Send
End With

Set OutMail = Nothing
Set OutApp = Nothing
With Application
.EnableEvents = True
.ScreenUpdating = True
End With

but the .Body = "Hi Bruce,This is invoice for today.Thanks & Regards,Farhad"
part in the email shows like: Hi Bruce,This is invoice for today.Thanks &
Regards,Farhad
and i wand it shows like:
Hi Bruce,

This is invoice for today.

Thanks & Regards,

Farhad

can anybody help me to do this?

Thanks alot,


--
Farhad Hodjat


"Ron de Bruin" wrote:

> Hi Farhad
>
> Try the Outlook object model examples from my site
> http://www.rondebruin.nl/sendmail.htm
>
> Click on the Tip link on each example page
>
>
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
> "Farhad" <(E-Mail Removed)> wrote in message news:3308444E-36B0-4749-89B8-(E-Mail Removed)...
> > Hi,
> >
> > i need to send a workbook to multiple persons and also CC to multiple
> > persons either in my VBA code.
> >
> > any helps would be much appriciated.
> >
> > Thanks,
> > --
> > Farhad Hodjat

>

 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      24th Sep 2007
Hi Farhad

Like I said, click on the tip link on each page
http://www.rondebruin.nl/mail/tips2.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Farhad" <(E-Mail Removed)> wrote in message news:9FEFA0F3-A9E2-4A1D-A769-(E-Mail Removed)...
> Thank you Ron,
>
> I put the code:
>
> Dim OutApp As Object
> Dim OutMail As Object
> With Application
> .EnableEvents = False
> .ScreenUpdating = False
> End With
> Set OutApp = CreateObject("Outlook.Application")
> OutApp.Session.Logon
> Set OutMail = OutApp.CreateItem(0)
> With OutMail
> .To = "(E-Mail Removed); (E-Mail Removed)"
> .cc = "(E-Mail Removed)"
> .Subject = BTNum & "-" & Trim(Str(Range("qty").Value)) & "
> Pieces (invoice#" & InvNTxBx.Value & ")"
> .Body = "Hi Bruce,This is invoice for today.Thanks &
> Regards,Farhad"
> .Attachments.Add ("F:\USERS\accounting\EXCEL" &
> Trim(Str(Val(Right(InvDTxBx, 4)))) & "\Toshiba\Toshiba " &
> Trim(Str(Val(Left(InvDTxBx, 2)))) & "\" & Crtra)
> .Display 'Or use Send
> End With
>
> Set OutMail = Nothing
> Set OutApp = Nothing
> With Application
> .EnableEvents = True
> .ScreenUpdating = True
> End With
>
> but the .Body = "Hi Bruce,This is invoice for today.Thanks & Regards,Farhad"
> part in the email shows like: Hi Bruce,This is invoice for today.Thanks &
> Regards,Farhad
> and i wand it shows like:
> Hi Bruce,
>
> This is invoice for today.
>
> Thanks & Regards,
>
> Farhad
>
> can anybody help me to do this?
>
> Thanks alot,
>
>
> --
> Farhad Hodjat
>
>
> "Ron de Bruin" wrote:
>
>> Hi Farhad
>>
>> Try the Outlook object model examples from my site
>> http://www.rondebruin.nl/sendmail.htm
>>
>> Click on the Tip link on each example page
>>
>>
>>
>> --
>>
>> Regards Ron de Bruin
>> http://www.rondebruin.nl/tips.htm
>>
>>
>> "Farhad" <(E-Mail Removed)> wrote in message news:3308444E-36B0-4749-89B8-(E-Mail Removed)...
>> > Hi,
>> >
>> > i need to send a workbook to multiple persons and also CC to multiple
>> > persons either in my VBA code.
>> >
>> > any helps would be much appriciated.
>> >
>> > Thanks,
>> > --
>> > Farhad Hodjat

>>

 
Reply With Quote
 
=?Utf-8?B?RmFyaGFk?=
Guest
Posts: n/a
 
      24th Sep 2007
Thank you Ron I learned very good things in VBA today.
--
Farhad Hodjat


"Ron de Bruin" wrote:

> Hi Farhad
>
> Like I said, click on the tip link on each page
> http://www.rondebruin.nl/mail/tips2.htm
>
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
> "Farhad" <(E-Mail Removed)> wrote in message news:9FEFA0F3-A9E2-4A1D-A769-(E-Mail Removed)...
> > Thank you Ron,
> >
> > I put the code:
> >
> > Dim OutApp As Object
> > Dim OutMail As Object
> > With Application
> > .EnableEvents = False
> > .ScreenUpdating = False
> > End With
> > Set OutApp = CreateObject("Outlook.Application")
> > OutApp.Session.Logon
> > Set OutMail = OutApp.CreateItem(0)
> > With OutMail
> > .To = "(E-Mail Removed); (E-Mail Removed)"
> > .cc = "(E-Mail Removed)"
> > .Subject = BTNum & "-" & Trim(Str(Range("qty").Value)) & "
> > Pieces (invoice#" & InvNTxBx.Value & ")"
> > .Body = "Hi Bruce,This is invoice for today.Thanks &
> > Regards,Farhad"
> > .Attachments.Add ("F:\USERS\accounting\EXCEL" &
> > Trim(Str(Val(Right(InvDTxBx, 4)))) & "\Toshiba\Toshiba " &
> > Trim(Str(Val(Left(InvDTxBx, 2)))) & "\" & Crtra)
> > .Display 'Or use Send
> > End With
> >
> > Set OutMail = Nothing
> > Set OutApp = Nothing
> > With Application
> > .EnableEvents = True
> > .ScreenUpdating = True
> > End With
> >
> > but the .Body = "Hi Bruce,This is invoice for today.Thanks & Regards,Farhad"
> > part in the email shows like: Hi Bruce,This is invoice for today.Thanks &
> > Regards,Farhad
> > and i wand it shows like:
> > Hi Bruce,
> >
> > This is invoice for today.
> >
> > Thanks & Regards,
> >
> > Farhad
> >
> > can anybody help me to do this?
> >
> > Thanks alot,
> >
> >
> > --
> > Farhad Hodjat
> >
> >
> > "Ron de Bruin" wrote:
> >
> >> Hi Farhad
> >>
> >> Try the Outlook object model examples from my site
> >> http://www.rondebruin.nl/sendmail.htm
> >>
> >> Click on the Tip link on each example page
> >>
> >>
> >>
> >> --
> >>
> >> Regards Ron de Bruin
> >> http://www.rondebruin.nl/tips.htm
> >>
> >>
> >> "Farhad" <(E-Mail Removed)> wrote in message news:3308444E-36B0-4749-89B8-(E-Mail Removed)...
> >> > Hi,
> >> >
> >> > i need to send a workbook to multiple persons and also CC to multiple
> >> > persons either in my VBA code.
> >> >
> >> > any helps would be much appriciated.
> >> >
> >> > Thanks,
> >> > --
> >> > Farhad Hodjat
> >>

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to send email to person in workbook list of users amorrison2006@googlemail.com Microsoft Excel Programming 3 19th May 2007 11:48 AM
Mail merge-send data of 3 person to 1 person in 1 letter =?Utf-8?B?TlAwNw==?= Microsoft Access External Data 0 24th Aug 2006 03:34 PM
Want one mailing label per person, but query can have multiple records per person Bob Richardson Microsoft Access 5 22nd Dec 2005 08:39 PM
In a shared workbook, can only one person "accept or reject" chang =?Utf-8?B?cGFtYQ==?= Microsoft Excel Misc 0 8th Sep 2005 01:45 PM
can only one person accept or reject changes in a shared workbook? =?Utf-8?B?cGFtYQ==?= Microsoft Excel Misc 0 7th Sep 2005 07:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:22 PM.