<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Omar AL Zabir blog on ASP.NET Ajax and .NET 3.5 : scripting</title><link>http://msmvps.com/blogs/omar/archive/tags/scripting/default.aspx</link><description>Tags: scripting</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Reply to all emails from unique sender in an Outlook folder </title><link>http://msmvps.com/blogs/omar/archive/2006/08/12/reply-to-all-emails-from-unique-sender-in-an-outlook-folder.aspx</link><pubDate>Sat, 12 Aug 2006 16:25:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:107441</guid><dc:creator>omar</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/omar/rsscomments.aspx?PostID=107441</wfw:commentRss><comments>http://msmvps.com/blogs/omar/archive/2006/08/12/reply-to-all-emails-from-unique-sender-in-an-outlook-folder.aspx#comments</comments><description>&lt;div style="PADDING-RIGHT:0in;MARGIN-TOP:0in;PADDING-LEFT:0in;FONT-SIZE:11pt;MARGIN-BOTTOM:0in;"&gt;

&lt;font face="Calibri"&gt;You have a folder full of mails from your
friends. Now you want to reply to each of them sending some fixed
message. One person will get only one reply no matter how many
mails are there from that user.&amp;nbsp; Here&amp;#39;s how you can do
this:&lt;/font&gt;
&lt;/div&gt;
&lt;div style="PADDING-RIGHT:0in;MARGIN-TOP:0in;PADDING-LEFT:0in;FONT-SIZE:11pt;MARGIN-BOTTOM:0in;"&gt;
&amp;nbsp;&lt;/div&gt;
&lt;ol style="MARGIN-TOP:0px;MARGIN-BOTTOM:0px;DIRECTION:ltr;unicode-bidi:embed;"&gt;
&lt;li style="MARGIN-TOP:0px;MARGIN-BOTTOM:0px;"&gt;
&lt;span style="FONT-SIZE:11pt;"&gt;
&lt;font face="Calibri"&gt;First write an email in Text Format.&lt;/font&gt;
&lt;/span&gt;
&lt;/li&gt;
&lt;li style="MARGIN-TOP:0px;MARGIN-BOTTOM:0px;"&gt;
&lt;span style="FONT-SIZE:11pt;"&gt;
&lt;font face="Calibri"&gt;Save the email. It will go to &amp;quot;Drafts&amp;quot; folder.
Now drag that email to the folder which contains all the emails you
want to reply to.&lt;/font&gt;
&lt;/span&gt;
&lt;/li&gt;
&lt;li style="MARGIN-TOP:0px;MARGIN-BOTTOM:0px;"&gt;
&lt;span style="FONT-SIZE:11pt;"&gt;
&lt;font face="Calibri"&gt;Now press ALT+F11 and paste the macro at the
end of the post.&lt;/font&gt;
&lt;/span&gt;
&lt;/li&gt;
&lt;li style="MARGIN-TOP:0px;MARGIN-BOTTOM:0px;"&gt;
&lt;span style="FONT-SIZE:11pt;"&gt;
&lt;font face="Calibri"&gt;Hit F5 and wait for a long time. You will see,
Outbox has all the reply emails.&lt;/font&gt;
&lt;/span&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div style="PADDING-RIGHT:0in;MARGIN-TOP:0in;PADDING-LEFT:0in;FONT-SIZE:11pt;MARGIN-BOTTOM:0in;"&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style="PADDING-RIGHT:0in;MARGIN-TOP:0in;PADDING-LEFT:0in;FONT-SIZE:11pt;MARGIN-BOTTOM:0in;"&gt;

&lt;font face="Calibri"&gt;The macro runs through each and every email
and then checks if the sender is already replied to. If not replied
to, then it gets the body of the message and then makes a reply by
combining your message with the body of the message.&lt;/font&gt;
&lt;/div&gt;
&lt;div style="PADDING-RIGHT:0in;MARGIN-TOP:0in;PADDING-LEFT:0in;FONT-SIZE:11pt;MARGIN-BOTTOM:0in;"&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div style="PADDING-RIGHT:0in;MARGIN-TOP:0in;PADDING-LEFT:0in;FONT-SIZE:11pt;MARGIN-BOTTOM:0in;"&gt;

&lt;font face="Calibri"&gt;The benefit of this approach is you are
replying to mails sent from someone which has low probability of
getting filtered out by spam filters.&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;pre&gt;
&lt;br /&gt;Sub ReplytoALLEmail()
&lt;/pre&gt;
&lt;pre&gt;
    Dim objFolder As Folder
&lt;br /&gt;    
&lt;br /&gt;    Dim objTemplate As MailItem
&lt;br /&gt;    Set objTemplate =
Application.ActiveExplorer.Selection.Item(1)
&lt;br /&gt;    
&lt;br /&gt;    Set objFolder = objTemplate.Parent
&lt;br /&gt;    
&lt;br /&gt;    Dim objItem As MailItem
&lt;br /&gt;    Dim objReply As MailItem
&lt;br /&gt;    
&lt;br /&gt;    Dim dic As New Dictionary
&lt;br /&gt;    
&lt;br /&gt;    Dim strEmail As String
&lt;br /&gt;    
&lt;br /&gt;    Dim strEmails As String
&lt;br /&gt;    
&lt;br /&gt;    Dim strBody As String
&lt;br /&gt;    strBody = objTemplate.Body
&lt;br /&gt;    
&lt;br /&gt;    For Each objItem In objFolder.Items
&lt;br /&gt;        If Not (objTemplate = objItem) Then
&lt;br /&gt;        
&lt;br /&gt;            strEmail = objItem.SenderEmailAddress
&lt;br /&gt;            
&lt;br /&gt;            If Not dic.Exists(strEmail) Then
&lt;br /&gt;                strEmails = strEmails + strEmail + &amp;quot;;&amp;quot;
&lt;br /&gt;                
&lt;br /&gt;                dic.Add strEmail, &amp;quot;&amp;quot;
&lt;br /&gt;                
&lt;br /&gt;                Set objReply = objItem.Reply()
&lt;br /&gt;                
&lt;br /&gt;                objReply.Body = strBody + vbCrLf + vbCrLf +
objItem.Body
&lt;br /&gt;                
&lt;br /&gt;                On Local Error Resume Next
&lt;br /&gt;                objReply.Send
&lt;br /&gt;            End If
&lt;br /&gt;        End If
&lt;br /&gt;        
&lt;br /&gt;    Next
&lt;br /&gt;    
&lt;br /&gt;    Debug.Print strEmails
&lt;br /&gt;End Sub
&lt;br /&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;div id="CSBloggerSig"&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=107441" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/omar/archive/tags/scripting/default.aspx">scripting</category></item><item><title>Send a message individually to all recipients using Outlook</title><link>http://msmvps.com/blogs/omar/archive/2006/08/09/send-a-message-individually-to-all-recipients-using-outlook.aspx</link><pubDate>Wed, 09 Aug 2006 13:59:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:107129</guid><dc:creator>omar</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/omar/rsscomments.aspx?PostID=107129</wfw:commentRss><comments>http://msmvps.com/blogs/omar/archive/2006/08/09/send-a-message-individually-to-all-recipients-using-outlook.aspx#comments</comments><description>&lt;p&gt;Say you have written a message which has lots of users in the
recipient list. Now you don&amp;#39;t want to send the mail to all those
users who can see each others email address. You want to send the
message one by one. Here&amp;#39;s what you do:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;After composing the message save it to make it go to Drafts
folder.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Select the message&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Press ALT+F11 to bring the Visual Basic Editor.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Now paste the following code:&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Sub SendIndividually()&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Dim objItem As MailItem
&lt;br /&gt;Set objItem =
Application.ActiveExplorer.Selection.Item(1)&lt;/p&gt;
&lt;p&gt;Dim objTo As Recipient
&lt;br /&gt;Dim objClonedMail As MailItem&lt;/p&gt;
&lt;p&gt;On Local Error Resume Next&lt;/p&gt;
&lt;p&gt;For Each objTo In objItem.Recipients&lt;/p&gt;
&lt;p&gt;Set objClonedMail = objItem.Copy()
&lt;br /&gt;objClonedMail.To = &amp;quot;&amp;quot;
&lt;br /&gt;objClonedMail.Recipients.Add objTo
&lt;br /&gt;objClonedMail.Send&lt;/p&gt;
&lt;p&gt;Next&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;Hit F5 and wait for a while. You will see Outbox is full of
copy of the message with individual recipient in the &amp;quot;To&amp;quot;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Read my previous post on how to generate a message with all the
sender&amp;#39;s email address from all the message in a folder. You can
combine both approach to send everyone important notice.&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=107129" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/omar/archive/tags/scripting/default.aspx">scripting</category></item><item><title>Get email address of all users from all mails in Outlook Folder</title><link>http://msmvps.com/blogs/omar/archive/2006/08/09/get-email-address-of-all-users-from-all-mails-in-outlook-folder.aspx</link><pubDate>Wed, 09 Aug 2006 12:55:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:107124</guid><dc:creator>omar</dc:creator><slash:comments>14</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/omar/rsscomments.aspx?PostID=107124</wfw:commentRss><comments>http://msmvps.com/blogs/omar/archive/2006/08/09/get-email-address-of-all-users-from-all-mails-in-outlook-folder.aspx#comments</comments><description>&lt;p&gt;Sometimes you want to send some important notice to everyone who
has ever mailed you. Let&amp;#39;s say you have a folder named &amp;quot;Friends&amp;quot; in
Outlook where you store all the emails from your friends. Now you
want to get all of their email addresses. Pretty difficult work if
you have thousands of such mails. Here&amp;#39;s an easy way.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Select the folder in Outlook and press ALT+F11. It will open
Visual Basic Editor.&lt;/li&gt;
&lt;li&gt;Double click on ThisOutlookSession from the Project tree.&lt;/li&gt;
&lt;li&gt;Paste the following function:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Sub GetALLEmailAddresses()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Dim objFolder As Folder
&lt;br /&gt;Set objFolder = Application.ActiveExplorer.Selection
&lt;br /&gt;
&lt;br /&gt;Dim dic As New Dictionary
&lt;br /&gt;Dim strEmail As String
&lt;br /&gt;Dim strEmails As String
&lt;br /&gt;
&lt;br /&gt;Dim objItem As MailItem
&lt;br /&gt;For Each objItem In objFolder.Items&lt;/p&gt;
&lt;p&gt;strEmail = objItem.SenderEmailAddress
&lt;br /&gt;If Not dic.Exists(strEmail) Then
&lt;br /&gt;strEmails = strEmails + strEmail + &amp;quot;;&amp;quot;
&lt;br /&gt;dic.Add strEmail, &amp;quot;&amp;quot;
&lt;br /&gt;End If
&lt;br /&gt;
&lt;br /&gt;Next&lt;/p&gt;
&lt;p&gt;Debug.Print strEmails
&lt;br /&gt;End Sub&lt;/p&gt;
&lt;p&gt;Hit F5 and it will run for a while. Then press Ctrl+G. You will
see the email addresses in the &amp;quot;Immediate
Window&amp;quot;.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Copy the whole string and you have all the email addresses from
all the emails in the selected Outlook folder. There will be no
duplicate address in the list.&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=107124" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/omar/archive/tags/scripting/default.aspx">scripting</category></item></channel></rss>