MyItem.To query

  • Thread starter Thread starter Wazza McG
  • Start date Start date
W

Wazza McG

Hi,

I send an email to about 30 people via a macro when a change in the work
schedule occurs at work. I use:

Set Outlook = CreateObject("outlook.application")
Worksheets("Projected Production").Select
MyDate = Range("F24")
MyStr = Format(MyDate, "dddd d mmm @ h:mm:ss AM/PM")
Set MyItem = Outlook.CreateItem(OutlookTaskItem)
MyItem.Subject = "Schedule Update! " & " Version " & " " & VersionNumber &
" - " & MyStr

MyItem.To = "(e-mail address removed), (e-mail address removed), etc etc"

The macro has worked well up until the line on the macro is full of email
addresses and tries to go the next line. Is there anyway I can expand the
list to go to a second line in my macro? I tried "& Chr(13) _" + "&" on the
following line and that did not work??

Any help would really be appreciated.

Regards,

Wazza McG
 
You could close off the first line as if it were the complete list, then
continue on the next line:
MyItem.To = MyItem.To & ", address1, address2"
 
If "to" accepts a string as you show, then

MyItem.To = "(e-mail address removed)," & _
"(e-mail address removed)," & _
"etc," & _
"etc"
 
That worked great. Thanks Tom.

Tom Ogilvy said:
If "to" accepts a string as you show, then

MyItem.To = "(e-mail address removed)," & _
"(e-mail address removed)," & _
"etc," & _
"etc"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top