<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Random thoughts of an overloaded mind &#187; vbscript</title>
	<atom:link href="http://blog.amarkulo.com/tag/vbscript/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.amarkulo.com</link>
	<description>Yet another technical blog about iOS, Windows, Linux, Arduino and everything else</description>
	<lastBuildDate>Tue, 13 Dec 2011 16:56:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Mass updating SaveAs field in outlook contacts</title>
		<link>http://blog.amarkulo.com/outlook-saveas-updating</link>
		<comments>http://blog.amarkulo.com/outlook-saveas-updating#comments</comments>
		<pubDate>Tue, 13 Jan 2009 15:49:47 +0000</pubDate>
		<dc:creator>amar</dc:creator>
				<category><![CDATA[Tips and tricks]]></category>
		<category><![CDATA[basic]]></category>
		<category><![CDATA[contacts]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[fileas]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[outlook]]></category>
		<category><![CDATA[save]]></category>
		<category><![CDATA[saveas]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[vb]]></category>
		<category><![CDATA[vbscript]]></category>
		<category><![CDATA[visual]]></category>

		<guid isPermaLink="false">http://dzo.blogsite.org/?p=181</guid>
		<description><![CDATA[If you ever had a problem that you needed to change SaveAs field in contacts in Microsoft Outlook on all contacts here is one small VB script that parse everything for you. The only thing that you need to do &#8230; <a href="http://blog.amarkulo.com/outlook-saveas-updating">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you ever had a problem that you needed to change SaveAs field in contacts in Microsoft Outlook on all contacts here is one small VB script that parse everything for you.</p>
<p>The only thing that you need to do is uncomment proper part of the code which is strFileAs.</p>
<p>In my case I wanted to everything be formated as Firstname Lastname instead of reverse way that is default in outlook.</p>
<p>Press alt+f11 to open vb editor, paste the code, edit strFileAs and press F5 to run it. When it&#8217;s done you will have your contacs sorted and changed in your way.</p>
<p>P.S. removing comment in vb means removing sign &#8216; in front of the line or text, so if you want to comment something write &#8216; in front of the line. In this case you will comment out <strong>strFileAs = .FullName</strong> part if you don&#8217;t want to be Firstname Lastname format and uncomment some other strFileAs line that fits your needs.</p>
<blockquote><p>Public Sub ChangeFileAs()<br />
Dim objOL As Outlook.Application<br />
Dim objNS As Outlook.NameSpace<br />
Dim objContact As Outlook.ContactItem<br />
Dim objItems As Outlook.Items<br />
Dim objContactsFolder As Outlook.MAPIFolder<br />
Dim obj As Object<br />
Dim strFirstName As String<br />
Dim strLastName As String<br />
Dim strFileAs As String</p>
<p>On Error Resume Next</p>
<p>Set objOL = CreateObject(&#8220;Outlook.Application&#8221;)<br />
Set objNS = objOL.GetNamespace(&#8220;MAPI&#8221;)<br />
Set objContactsFolder = objNS.GetDefaultFolder(olFolderContacts)<br />
Set objItems = objContactsFolder.Items</p>
<p>For Each obj In objItems<br />
&#8216;Test for contact and not distribution list<br />
If obj.Class = olContact Then<br />
Set objContact = obj</p>
<p>With objContact<br />
&#8216; Uncomment the  strFileAs line for the desired format</p>
<p>&#8216;Lastname, Firstname (Company) format<br />
&#8216; strFileAs = .FullNameAndCompany</p>
<p>&#8216;Firstname Lastname format<br />
strFileAs = .FullName</p>
<p>&#8216;Lastname, Firstname format<br />
&#8216; strFileAs = .LastNameAndFirstName</p>
<p>&#8216;Company name only<br />
&#8216; strFileAs = .CompanyName</p>
<p>&#8216;Companyname (Lastname, Firstname)<br />
&#8216; strFileAs = .CompanyAndFullName</p>
<p>.FileAs = strFileAs</p>
<p>.Save<br />
End With<br />
End If</p>
<p>Err.Clear<br />
Next</p>
<p>Set objOL = Nothing<br />
Set objNS = Nothing<br />
Set obj = Nothing<br />
Set objContact = Nothing<br />
Set objItems = Nothing<br />
Set objContactsFolder = Nothing<br />
End Sub</p></blockquote>
<hr>
<p><div class="entry-utility">If you don't already have a <a href="http://db.tt/aqrG0tY">Dropbox</a> account then you can create it by clicking on my <a href="http://db.tt/aqrG0tY">affiliate link</a>. You will receive 2GB free account + 250 MB extra and I will receive 250 MB as well. Win-Win :-)</div></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amarkulo.com/outlook-saveas-updating/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

