Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-16-2015, 06:42 AM
johnc83 johnc83 is offline VBScript - outlook does not recognize one or more recipients Windows 7 64bit VBScript - outlook does not recognize one or more recipients Office 2003
Novice
VBScript - outlook does not recognize one or more recipients
 
Join Date: Jul 2015
Posts: 6
johnc83 is on a distinguished road
Default

I've given up and written an alternative. Its Excel 2003 VBA that is creating the VBS file ready to send the email.

My sub receives a single string (Called 'Recipients') containing multiple email addresses and splits them out into individual ones..

Code:
'GET EMAIL ADDRESSES
EmailList = Recipients
For x = 0 To 10000
If InStr(EmailList, ";") = 0 Then 'if 0 then no more semi-colons meaning you are at last email address in list
x = 10000
Print #fnum, "objMailItem.Recipients.Add (""" & EmailList & """)"
Else
'Get position of semi-colin
SemiColPos = InStr(EmailList, ";")
'Get email address
EmailAddress = Mid(EmailList, 1, SemiColPos - 1)
Print #fnum, "objMailItem.Recipients.Add (""" & EmailAddress & """)"
'remove previous email address from list (by starting new string after first semiCol
EmailList = Mid(EmailList, SemiColPos + 1, 100)
End If
Next
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook invitation shows my entire calendar to recipients deltaskye Outlook 0 04-05-2014 08:24 AM
VBScript - outlook does not recognize one or more recipients VBScript.RegExp: exclude a particular word tinfanide Excel Programming 2 06-07-2012 06:52 AM
VBScript - outlook does not recognize one or more recipients Changed data base name. Outlook doesn't recognize. Skip Outlook 1 10-20-2011 10:55 AM
Outlook 2010 send emails to unintended recipients. enviroko Outlook 7 06-20-2011 06:21 PM
VbScript to Print a .pdf DaveB Excel 2 03-07-2009 12:36 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:15 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft