<?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>MakeUseOf &#187; visual basic</title>
	<atom:link href="http://www.makeuseof.com/tags/visual-basic/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.makeuseof.com</link>
	<description>Cool Websites, Software and Internet Tips</description>
	<lastBuildDate>Fri, 10 Feb 2012 21:01:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How To Export Your Outlook Tasks To Excel With VBA</title>
		<link>http://www.makeuseof.com/tag/export-outlook-tasks-excel-vba/</link>
		<comments>http://www.makeuseof.com/tag/export-outlook-tasks-excel-vba/#comments</comments>
		<pubDate>Fri, 10 Feb 2012 17:01:28 +0000</pubDate>
		<dc:creator>Ryan Dube</dc:creator>
				<category><![CDATA[Cool Windows Apps & Tricks]]></category>
		<category><![CDATA[microsoft excel]]></category>
		<category><![CDATA[microsoft outlook]]></category>
		<category><![CDATA[spreadsheet]]></category>
		<category><![CDATA[tasks]]></category>
		<category><![CDATA[visual basic]]></category>

		<guid isPermaLink="false">http://www.makeuseof.com/?p=98984</guid>
		<description><![CDATA[Whether or not you are a fan of Microsoft, one good thing that can be said about MS Office products, at least, is how easy it is to integrate each of them with one another. Just think of the power that comes from having incoming emails automatically generating new tasks or new calendar appointments, or having a completed task automatically email your boss with the updated status report from the task description.]]></description>
			<content:encoded><![CDATA[<p><img class="align-right" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/02/greenmarker.png?323f2c" alt="" />Whether or not you are a fan of Microsoft, one good thing that can be said about MS Office products, at least, is how easy it is to integrate each of them with one another.</p>
<p>Just think of the power that comes from having incoming emails automatically generating new tasks or new calendar appointments, or having a completed task automatically email your boss with the updated status report from the task description.</p>
<p>If you do it right, you can cut your entire day&#8217;s workload by a boatload just by automating things in an intelligent and efficient way.</p>
<p>If you follow my writing here, then you know that in the past I&#8217;ve covered things like integrating <a href="http://www.makeuseof.com/tag/basic-internet-browser-vba/">web browser features into Excel</a>, automatically <a href="http://www.makeuseof.com/tag/3-ways-open-applications-windows-maximized-vb-script/">maximizing application windows</a>, or automating <a href="http://www.makeuseof.com/tag/how-to-create-self-updating-excel-charts-in-three-easy-steps/">chart updates in Excel</a>.</p>
<p>Well, in this article I&#8217;m going to cover another automation task &#8211; actually one that I&#8217;ve used often more recently &#8211; to automatically update an Excel spreadsheet with all of your remaining active Outlook tasks at the end of the day.</p>
<h2>Feeding Outlook Tasks To An Excel Spreadsheet</h2>
<p>There are a lot of reasons you may want to do this. Maybe you want to track your unfinished tasks on a daily basis in a format that you can quickly mail off to someone (not so easy to do with Outlook tasks). Or maybe it&#8217;ll become part of a larger report that you&#8217;ll be typing up in Word.</p>
<p>Whatever the case may be, the ability to capture and output uncompleted Outlook task information is a useful thing.</p>
<p>For this example, here&#8217;s my sample Outlook task list with 5 remaining tasks that I still haven&#8217;t completed yet.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/02/outlook2b.png?323f2c" alt="" width="495" height="201" /></p>
<p>Everything we&#8217;re going to do here, is in VBA. In Outlook, you get to the VBA editor by clicking on &#8220;<em>Tools</em>&#8220;, then &#8220;<em>Macro</em>&#8221; and then choosing the &#8220;<em>Visual Basic Editor</em>&#8220;.</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/02/outlook1.png?323f2c" alt="" width="405" height="375" /></p>
<p>The code that you&#8217;re going to use to capture your task list and export it to Excel is actually not quite as complicated as you might think. The first step is to plug into both Outlook objects and Excel objects by creating the necessary variable definitions. Then, using the workbook object you&#8217;ve created, start off by creating the header in your spreadsheet.</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #151B8D; font-weight: bold;">Dim</span> strReport <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">String</span>
  <span style="color: #151B8D; font-weight: bold;">Dim</span> olnameSpace <span style="color: #151B8D; font-weight: bold;">As</span> Outlook.NameSpace
  <span style="color: #151B8D; font-weight: bold;">Dim</span> taskFolder <span style="color: #151B8D; font-weight: bold;">As</span> Outlook.MAPIFolder
  <span style="color: #151B8D; font-weight: bold;">Dim</span> tasks <span style="color: #151B8D; font-weight: bold;">As</span> Outlook.Items
  <span style="color: #151B8D; font-weight: bold;">Dim</span> tsk <span style="color: #151B8D; font-weight: bold;">As</span> Outlook.TaskItem
  <span style="color: #151B8D; font-weight: bold;">Dim</span> objExcel <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #E56717; font-weight: bold;">New</span> Excel.Application
  <span style="color: #151B8D; font-weight: bold;">Dim</span> exWb <span style="color: #151B8D; font-weight: bold;">As</span> Excel.Workbook
  <span style="color: #151B8D; font-weight: bold;">Dim</span> sht <span style="color: #151B8D; font-weight: bold;">As</span> Excel.Worksheet
&nbsp;
  <span style="color: #151B8D; font-weight: bold;">Dim</span> strMyName <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">String</span>
  <span style="color: #151B8D; font-weight: bold;">Dim</span> x <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Integer</span>
  <span style="color: #151B8D; font-weight: bold;">Dim</span> y <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Integer</span>
&nbsp;
  <span style="color: #151B8D; font-weight: bold;">Set</span> exWb = objExcel.Workbooks.<span style="color: #151B8D; font-weight: bold;">Open</span>(<span style="color: #800000;">&quot;c:\temp\MyActiveTasks.xls&quot;</span>)
&nbsp;
<span style="color: #008000;">'  exWb.Sheets(strMyName).Delete
</span><span style="color: #008000;">'  exWb.Sheets.Add (strMyName)
</span>
  <span style="color: #151B8D; font-weight: bold;">Set</span> olnameSpace = Application.GetNamespace(<span style="color: #800000;">&quot;MAPI&quot;</span>)
  <span style="color: #151B8D; font-weight: bold;">Set</span> taskFolder = olnameSpace.GetDefaultFolder(olFolderTasks)
&nbsp;
  <span style="color: #151B8D; font-weight: bold;">Set</span> tasks = taskFolder.Items
&nbsp;
  strReport = <span style="color: #800000;">&quot;&quot;</span>
&nbsp;
  <span style="color: #008000;">'Create Header
</span>  exWb.Sheets(<span style="color: #800000;">&quot;Sheet1&quot;</span>).Cells(1, 1) = <span style="color: #800000;">&quot;Subject&quot;</span>
  exWb.Sheets(<span style="color: #800000;">&quot;Sheet1&quot;</span>).Cells(1, 2) = <span style="color: #800000;">&quot;Due Date&quot;</span>
  exWb.Sheets(<span style="color: #800000;">&quot;Sheet1&quot;</span>).Cells(1, 3) = <span style="color: #800000;">&quot;Percent Complete&quot;</span>
  exWb.Sheets(<span style="color: #800000;">&quot;Sheet1&quot;</span>).Cells(1, 4) = <span style="color: #800000;">&quot;Status&quot;</span></pre></div></div>

<p>So, here&#8217;s what the new spreadsheet looks like. Your Outlook app just created a new Excel file called &#8220;MyActiveTasks.xls&#8221; in the C:\temp directory, and created a header for the tasks that you&#8217;re about to insert.</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/02/outlook3.png?323f2c" alt="" width="400" height="262" /></p>
<p>So, now it&#8217;s time to extract your tasks and insert them into the Excel file. I use a &#8220;y&#8221; variable starting at two in order to make sure the first row that&#8217;s used isn&#8217;t the first, because I don&#8217;t want to overwrite the header.</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;">y = 2
&nbsp;
  <span style="color: #8D38C9; font-weight: bold;">For</span> x = 1 <span style="color: #8D38C9; font-weight: bold;">To</span> tasks.Count
&nbsp;
       <span style="color: #151B8D; font-weight: bold;">Set</span> tsk = tasks.Item(x)
&nbsp;
       <span style="color: #008000;">'strReport = strReport + tsk.Subject + &quot;; &quot;
</span>
       <span style="color: #008000;">'Fill in Data
</span>       <span style="color: #8D38C9; font-weight: bold;">If</span> <span style="color: #8D38C9; font-weight: bold;">Not</span> tsk.Complete <span style="color: #8D38C9; font-weight: bold;">Then</span>
&nbsp;
        exWb.Sheets(<span style="color: #800000;">&quot;Ryan&quot;</span>).Cells(y, 1) = tsk.Subject
        exWb.Sheets(<span style="color: #800000;">&quot;Ryan&quot;</span>).Cells(y, 2) = tsk.DueDate
        exWb.Sheets(<span style="color: #800000;">&quot;Ryan&quot;</span>).Cells(y, 3) = tsk.PercentComplete
        exWb.Sheets(<span style="color: #800000;">&quot;Ryan&quot;</span>).Cells(y, 4) = tsk.Status
        y = y + 1
&nbsp;
       <span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #8D38C9; font-weight: bold;">If</span>
&nbsp;
  <span style="color: #8D38C9; font-weight: bold;">Next</span> x</pre></div></div>

<p>What this script does is searches through your entire list of task items in Outlook, checks to see whether the item is completed yet, and if it isn&#8217;t, then it inserts that task information into 4 cells of the spreadsheet. If you wanted to, you could insert more information. Just explore what task information is available by typing &#8220;tsk.&#8221; and then browsing through the list of properties that pop up.</p>
<p>Now here&#8217;s what the sheet looks like.</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/02/outlook41.png?323f2c" alt="" width="400" height="276" /></p>
<p>Being a bit of a perfectionist, there&#8217;s still a problem. Notice how column A clipped the last task subject?&#8221; I don&#8217;t like that. So let&#8217;s add a little bit more code to autofit all columns in the Excel table.</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #008000;">'Autofit all column widths
</span>
<span style="color: #8D38C9; font-weight: bold;">For</span> <span style="color: #8D38C9; font-weight: bold;">Each</span> sht <span style="color: #8D38C9; font-weight: bold;">In</span> ActiveWorkbook.Worksheets
    sht.Columns(<span style="color: #800000;">&quot;A&quot;</span>).EntireColumn.AutoFit
    sht.Columns(<span style="color: #800000;">&quot;B&quot;</span>).EntireColumn.AutoFit
    sht.Columns(<span style="color: #800000;">&quot;C&quot;</span>).EntireColumn.AutoFit
    sht.Columns(<span style="color: #800000;">&quot;D&quot;</span>).EntireColumn.AutoFit
<span style="color: #8D38C9; font-weight: bold;">Next</span> sht
&nbsp;
exWb.Save
exWb.<span style="color: #8D38C9; font-weight: bold;">Close</span>
&nbsp;
<span style="color: #151B8D; font-weight: bold;">Set</span> exWb = <span style="color: #00C2FF; font-weight: bold;">Nothing</span></pre></div></div>

<p>The <em>Save</em> and <em>Close</em> methods in those last few lines will save the sheet and close it so that it doesn&#8217;t remain locked by the application, otherwise it would be difficult to open the Excel file until you closed Outlook.</p>
<p>So, now here&#8217;s what the finished spreadsheet looks like.</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/02/outlook5.png?323f2c" alt="" width="404" height="273" /></p>
<p>When do you set the script to run? Well, I set it up to run on the <em>&#8220;Application.Close()&#8221;</em> event, which runs when you exit Outlook at the end of the day. This will make outlook produce the Excel spreadsheet report at the end of the day, all on its own.</p>
<p>Can you think of any other cool uses for this technique? Maybe automatically firing off an email with the list of tasks, or outputting them to an HTML file and FTPing it to your web server?</p>
<p>With a little creativity, it&#8217;s amazing what you can pull off with a bit of scripting automation. Share your own thoughts and ideas in the comments section below!</p>
<p><small><a href="http://image.shutterstock.com/display_pic_with_logo/581935/581935,1316276762,1/stock-photo-one-paper-with-an-empty-to-do-list-with-green-check-marks-and-a-green-pen-84810577.jpg" rel="nofollow">Shutterstock</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.makeuseof.com/tag/export-outlook-tasks-excel-vba/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Integrate Excel Data Into A Word Document</title>
		<link>http://www.makeuseof.com/tag/integrate-excel-data-word-document/</link>
		<comments>http://www.makeuseof.com/tag/integrate-excel-data-word-document/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 19:01:15 +0000</pubDate>
		<dc:creator>Ryan Dube</dc:creator>
				<category><![CDATA[Cool Windows Apps & Tricks]]></category>
		<category><![CDATA[How-To Articles]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[documents]]></category>
		<category><![CDATA[microsoft excel]]></category>
		<category><![CDATA[microsoft word]]></category>
		<category><![CDATA[visual basic]]></category>

		<guid isPermaLink="false">http://www.makeuseof.com/?p=98678</guid>
		<description><![CDATA[During your work week, there are probably lots of times that you find yourself copying and pasting information from Excel into Word, or the other way around. This is how people often produce written reports based on data that’s accumulated and updated in an Excel spreadsheet. In this article, I’m going to dive a little more into the background VBA scripting that allows you to actually program connections between data in Excel and Word.]]></description>
			<content:encoded><![CDATA[<p><img class="align-right" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/womancomputer.png?323f2c" alt="" />During your work week, there are probably lots of times that you find yourself copying and pasting information from Excel into Word, or the other way around.</p>
<p>This is how people often produce written reports based on data that&#8217;s accumulated and updated in an Excel spreadsheet. We&#8217;ve offered a lot of really cool tips and tools for Excel over the years, such as Saikat&#8217;s article on producing <a href="http://www.makeuseof.com/tag/create-attractive-professional-charts-chart-tools-ms-word-2010/">professional looking charts</a>, and Steve&#8217;s article on cool <a href="http://www.makeuseof.com/tag/excel-project-management-tracking-templates/">Excel templates for project management</a>.</p>
<p>In this article, I&#8217;m going to dive a little more into the background VBA scripting that allows you to actually program connections between data that might be stored in an Excel file and Word documents where you may be producing reports.</p>
<p>It&#8217;s actually surprisingly easy to accomplish this once you know how to add the right references, and how to lay out the syntax of the background VBA code.</p>
<h2>Integrating Data From Excel Into Your Word Document</h2>
<p>In this example, I&#8217;m going to start out with a fairly simple Excel spreadsheet. In reality, the Excel file can consist of multiple spreadsheets with lots of data, it doesn&#8217;t matter.</p>
<p>So long as you know where the data resides in the spreadsheet, you&#8217;ll be able to reach in and grab it using VBA.</p>
<p>Here&#8217;s what my sample spreadsheet looks like. It&#8217;s a list of expense totals that have been calculated throughout the entire year.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/exceltoword1a.png?323f2c" alt="" width="261" height="295" /></p>
<p>Now, lets say you have a manager that would like to see a nicely formatted report that describes the expenses, grouping together like items and laying it all out in a layout that&#8217;s a little more pleasing to the eye (and easier for the big boys upstairs to understand).</p>
<p>You can do this by incorporating objects like textboxes or labels into your Word document. When you&#8217;re in Word, just click on the <em>Developer</em> menu tab, and then select &#8220;<em>Design Mode</em>&#8221; in the Controls box. Use the <em>Legacy Tools</em> dropdown icon to find where you can insert labels into your document.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/exceltoword1.png?323f2c" alt="" width="490" height="515" /></p>
<p>Once you have the label placed in the document where you want it (not always an easy task), you&#8217;re ready to program the data feed. But first you&#8217;ll need to name the label so that the VBA can identify it. Right click on the label and go into <em>Properties</em>. Find the <em>&#8220;(Name)&#8221;</em> field and call it something that you&#8217;ll remember.</p>
<p>Now, add a Command Button from the same Legacy Tools dropdown list, place it in your document, and double click it to open up the VBA editor. When you get your code working later, you can modify it so that the code runs on the Document Open() event. You&#8217;ll see that in the object dropdown boxes in the editor window.</p>
<p>To get started connecting Word to Excel, you&#8217;ll need to reference Excel. Click on <em>Tools</em>, and then <em>References</em>. Scroll down the list until you see the &#8220;<em>Microsoft Excel 12.0 Object Library</em>&#8221; and select it.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/exceltoword4.png?323f2c" alt="" width="522" height="471" /></p>
<p>Once you&#8217;ve done this, the rest is just a matter of writing a ridiculously simple VBA script to pull in data from an Excel spreadsheet and automatically update the label caption with the data. Here&#8217;s how that works.</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #E56717; font-weight: bold;">Private</span> <span style="color: #E56717; font-weight: bold;">Sub</span> CommandButton1_Click()
<span style="color: #151B8D; font-weight: bold;">Dim</span> objExcel <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #E56717; font-weight: bold;">New</span> Excel.Application
<span style="color: #151B8D; font-weight: bold;">Dim</span> exWb <span style="color: #151B8D; font-weight: bold;">As</span> Excel.Workbook
&nbsp;
<span style="color: #151B8D; font-weight: bold;">Set</span> exWb = objExcel.Workbooks.<span style="color: #151B8D; font-weight: bold;">Open</span>(<span style="color: #800000;">&quot;c:\temp\expenses.xls&quot;</span>)
&nbsp;
ThisDocument.yrTotal.Caption = exWb.Sheets(<span style="color: #800000;">&quot;Sheet1&quot;</span>).Cells(12, 2)
&nbsp;
exWb.<span style="color: #8D38C9; font-weight: bold;">Close</span>
&nbsp;
<span style="color: #151B8D; font-weight: bold;">Set</span> exWb = <span style="color: #00C2FF; font-weight: bold;">Nothing</span>
&nbsp;
<span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #E56717; font-weight: bold;">Sub</span></pre></div></div>

<p>See how that works? The &#8220;exWb&#8221; Excel application object opens the Excel file at the path you provide it, and it&#8217;ll go right into the specific sheet and cell number, extract the data, and place it into the Caption property of the label that you named &#8220;<em>yrTotal</em>&#8220;.</p>
<p>Here&#8217;s the VBA macro in action.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/exceltoword5.png?323f2c" alt="" width="399" height="104" /></p>
<p>The hard part with dealing with labels in Word is that it&#8217;s sometimes hard to align it at the end of a sentence or alongside any other text.</p>
<p>One way of overcoming that is actually incorporating some of the text alongside the data in the VBA code itself.  As you can see here, I&#8217;ve put the static text right into the Caption when I create the label itself.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/exceltoword6.png?323f2c" alt="" width="336" height="212" /></p>
<p>Now, all you have to do is include that text when you update the label with your VBA script, and just append the data from the Excel file to the end of that text. Here&#8217;s what that kind of code would look like.</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #151B8D; font-weight: bold;">Dim</span> objExcel <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #E56717; font-weight: bold;">New</span> Excel.Application
<span style="color: #151B8D; font-weight: bold;">Dim</span> exWb <span style="color: #151B8D; font-weight: bold;">As</span> Excel.Workbook
&nbsp;
<span style="color: #151B8D; font-weight: bold;">Set</span> exWb = objExcel.Workbooks.<span style="color: #151B8D; font-weight: bold;">Open</span>(<span style="color: #800000;">&quot;c:\temp\expenses.xls&quot;</span>)
&nbsp;
ThisDocument.yrTotal.Caption = exWb.Sheets(<span style="color: #800000;">&quot;Sheet1&quot;</span>).Cells(12, 2)
ThisDocument.totHotels.Caption = <span style="color: #800000;">&quot;Hotels: &quot;</span> &amp;amp; exWb.Sheets(<span style="color: #800000;">&quot;Sheet1&quot;</span>).Cells(5, 2)
ThisDocument.TotDining.Caption = <span style="color: #800000;">&quot;Dining Out: &quot;</span> &amp;amp; exWb.Sheets(<span style="color: #800000;">&quot;Sheet1&quot;</span>).Cells(2, 2)
ThisDocument.totTolls.Caption = <span style="color: #800000;">&quot;Tolls: &quot;</span> &amp;amp; exWb.Sheets(<span style="color: #800000;">&quot;Sheet1&quot;</span>).Cells(3, 2)
ThisDocument.totFuel.Caption = <span style="color: #800000;">&quot;Fuel: &quot;</span> &amp;amp; exWb.Sheets(<span style="color: #800000;">&quot;Sheet1&quot;</span>).Cells(10, 2)
&nbsp;
exWb.<span style="color: #8D38C9; font-weight: bold;">Close</span>
&nbsp;
<span style="color: #151B8D; font-weight: bold;">Set</span> exWb = <span style="color: #00C2FF; font-weight: bold;">Nothing</span></pre></div></div>

<p>You can use the string concatenation &#8220;&amp;&#8221; symbol to place connect the static text with the data extracted from the Excel sheet. Here&#8217;s what the final results look like in the updated Word document.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/exceltoword7.png?323f2c" alt="" width="542" height="328" /></p>
<p>Again, if you don&#8217;t want to have a big, ugly grey command button in your word document, just have the data-update script run on Document.Open(), and it&#8217;ll all take place behind the scenes.</p>
<p>In fact, in many cases you could create the initial document once, and then you&#8217;ll never have to create it again. All you&#8217;ll have to do is open it, and all of the labels will automatically update for you with the data from the updated Excel file. All you have to do is click to Print, and submit the report to your manager. A 30 minute report just turned into a 1 minute printout!</p>
<p>Can you think of any other cool uses for this data-integration technique using VBA? Share some of your own ideas and thoughts in the comments section below.</p>
<p><small><a href="http://image.shutterstock.com/display_pic_with_logo/59253/59253,1264063933,1/stock-photo-business-woman-in-office-using-desktop-computer-44970433.jpg" rel="nofollow">Shutterstock</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.makeuseof.com/tag/integrate-excel-data-word-document/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Send Emails From An Excel Spreadsheet Using VBA Scripts</title>
		<link>http://www.makeuseof.com/tag/send-emails-excel-vba/</link>
		<comments>http://www.makeuseof.com/tag/send-emails-excel-vba/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 22:31:02 +0000</pubDate>
		<dc:creator>Ryan Dube</dc:creator>
				<category><![CDATA[Cool Windows Apps & Tricks]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[email tips]]></category>
		<category><![CDATA[microsoft excel]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[visual basic]]></category>

		<guid isPermaLink="false">http://www.makeuseof.com/?p=98665</guid>
		<description><![CDATA[In the past, I’ve used email a whole lot in my batch jobs and other automated scripts, just like I’ve described in past articles. These are great for those times when you have a script that’s monitoring the health of a computer or the status of a specific process, but what if you want to automate sending emails from within Office products like Word or Excel?]]></description>
			<content:encoded><![CDATA[<p><img class="align-right" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/emaillaptop.png?323f2c" alt="email from excel" />Using emails as part of any program is a nice way to automate important tasks, and it also significantly improves the value and functionality of any program or script.</p>
<p>In the past, I&#8217;ve used email a whole lot in my batch jobs and other automated scripts, just like I&#8217;ve described in past articles here on using tools like <a href="http://www.makeuseof.com/tag/send-automated-emails-save-time-sendemail-windows-task-scheduler/">Sendmail</a> or <a href="http://www.makeuseof.com/tag/easily-quickly-send-command-line-emails-blat/">Blat</a> to issue emails straight from the command line, or from within a command line script.</p>
<p>These are great for those times when you have a script that&#8217;s monitoring the health of a computer or the status of a specific process, but what if you want to automate sending emails from within Office products like Word or Excel?</p>
<p>There are a lot of reasons why you might want to do so. Maybe you have staff that update documents or spreadsheets on a weekly basis, and you&#8217;d like to receive an email notification of when those updates take place, and even a report of the data from within those sheets. There are a few techniques you can use to program automated emails from within Excel, but my favorite remains CDO.</p>
<h2>Sending Emails From Within Excel</h2>
<p>You&#8217;re probably thinking that scripting outgoing email into an Excel VBA script is going to be painfully complicated. Well, that&#8217;s not the case at all.</p>
<p>CDO is a messaging component used in Windows for a few generations of the OS. It used to be called CDONTS, and then with the advent of Windows 2000 and XP, it was replaced with &#8220;CDO for Windows 2000&#8243;. This component is already included in your VBA installation within Word or Excel and it&#8217;s ready for use.</p>
<p>Using the component makes sending emails from within Windows products with VBA extremely easy. In this example, I&#8217;m going to use the CDO component in Excel to send out an email that will deliver the results from a specific Excel cell.</p>
<p>The first step is to go to the &#8220;<em>Developer</em>&#8221; menu tab, click on &#8220;<em>Insert</em>&#8221; in the Controls box, and then select a command button. Draw it into the sheet and then create a new macro for it.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/outlookvba1.png?323f2c" alt="email from excel" width="525" height="395" /></p>
<p style="text-align: left;">When Excel opens up the VBA editor, you&#8217;re going to need to add the reference to the CDO library. You can access this in the Tools menu, and then scroll down the list until you find &#8220;<em>Microsoft CDO for Windows 2000 Library</em>&#8220;. Select the checkbox and click OK.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/outlookvba2.png?323f2c" alt="send email from excel" width="553" height="504" /></p>
<p style="text-align: left;">Now you&#8217;re ready to use CDO to issue emails from inside Excel. To do this, you first need ot create the mail objects and set up all of the fields that will be required for sending the email. Keep in mind that while many of the fields are optional, the From and To fields are required.</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #151B8D; font-weight: bold;">Dim</span> CDO_Mail <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Object</span>
<span style="color: #151B8D; font-weight: bold;">Dim</span> CDO_Config <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Object</span>
<span style="color: #151B8D; font-weight: bold;">Dim</span> SMTP_Config <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">Variant</span>
<span style="color: #151B8D; font-weight: bold;">Dim</span> strSubject <span style="color: #151B8D; font-weight: bold;">as</span> <span style="color: #F660AB; font-weight: bold;">String</span>
<span style="color: #151B8D; font-weight: bold;">Dim</span> strFrom <span style="color: #151B8D; font-weight: bold;">as</span> <span style="color: #F660AB; font-weight: bold;">String</span>
<span style="color: #151B8D; font-weight: bold;">Dim</span> strTo <span style="color: #151B8D; font-weight: bold;">as</span> <span style="color: #F660AB; font-weight: bold;">String</span>
<span style="color: #151B8D; font-weight: bold;">Dim</span> strCc <span style="color: #151B8D; font-weight: bold;">as</span> <span style="color: #F660AB; font-weight: bold;">String</span>
<span style="color: #151B8D; font-weight: bold;">Dim</span> strBcc <span style="color: #151B8D; font-weight: bold;">as</span> <span style="color: #F660AB; font-weight: bold;">String</span>
<span style="color: #151B8D; font-weight: bold;">Dim</span> strBody <span style="color: #151B8D; font-weight: bold;">As</span> <span style="color: #F660AB; font-weight: bold;">String</span>
&nbsp;
strSubject = <span style="color: #800000;">&quot;Results from Excel Spreadsheet&quot;</span>
strFrom = <span style="color: #800000;">&quot;ryxxxxxx@xxxxxcast.net&quot;</span>
strTo = <span style="color: #800000;">&quot;rdxxxxxx@gmail.com&quot;</span>
strCc = <span style="color: #800000;">&quot;&quot;</span>
strBcc = <span style="color: #800000;">&quot;&quot;</span>
strBody = <span style="color: #800000;">&quot;The total results for this quarter are: &quot;</span> &amp;amp; Str(Sheet1.Cells(2, 1))</pre></div></div>

<p>The cool thing about this is that you an build up any string you want to customize a full email message and assign it to the strBody variable. Piece together components of the message by using the &#8220;&amp;&#8221; string to insert data from any of the Excel sheets right into the email message, just like I&#8217;ve shown above.</p>
<p>The next section of code is where you will configure CDO to use any external SMTP server that you want to use. In this case I don&#8217;t need to use SSL because my SMTP server doesn&#8217;t require it. CDO is capable of SSL, but that&#8217;s outside the scope of this article. If you need to use SSL, I highly recommend Paul Sadowski&#8217;s <a href="http://www.paulsadowski.com/wsh/cdo.htm">awesome writeup</a> on using CDO.</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #151B8D; font-weight: bold;">Set</span> CDO_Mail = <span style="color: #E56717; font-weight: bold;">CreateObject</span>(<span style="color: #800000;">&quot;CDO.Message&quot;</span>)
<span style="color: #151B8D; font-weight: bold;">On</span> <span style="color: #151B8D; font-weight: bold;">Error</span> <span style="color: #8D38C9; font-weight: bold;">GoTo</span> Error_Handling
&nbsp;
<span style="color: #151B8D; font-weight: bold;">Set</span> CDO_Config = <span style="color: #E56717; font-weight: bold;">CreateObject</span>(<span style="color: #800000;">&quot;CDO.Configuration&quot;</span>)
CDO_Config.Load -1
&nbsp;
<span style="color: #151B8D; font-weight: bold;">Set</span> SMTP_Config = CDO_Config.Fields
&nbsp;
<span style="color: #8D38C9; font-weight: bold;">With</span> SMTP_Config
    .Item(<span style="color: #800000;">&quot;http://schemas.microsoft.com/cdo/configuration/sendusing&quot;</span>) = 2
    .Item(<span style="color: #800000;">&quot;http://schemas.microsoft.com/cdo/configuration/smtpserver&quot;</span>) = <span style="color: #800000;">&quot;smtp.metrocast.net&quot;</span>
    .Item(<span style="color: #800000;">&quot;http://schemas.microsoft.com/cdo/configuration/smtpserverport&quot;</span>) = 25
    .Update
<span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #8D38C9; font-weight: bold;">With</span>
&nbsp;
<span style="color: #8D38C9; font-weight: bold;">With</span> CDO_Mail
    <span style="color: #151B8D; font-weight: bold;">Set</span> .Configuration = CDO_Config
<span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #8D38C9; font-weight: bold;">With</span></pre></div></div>

<p>Now that you&#8217;ve configured the connection to the SMTP server for sending the email, all you have to do is fill in the appropriate fields for the CDO_Mail object, and issue the Send command. This is how you do that.</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;">CDO_Mail.Subject = strSubject
CDO_Mail.From = strFrom
CDO_Mail.<span style="color: #8D38C9; font-weight: bold;">To</span> = strTo
CDO_Mail.TextBody = strBody
CDO_Mail.CC = strCc
CDO_Mail.BCC = strBcc
CDO_Mail.Send
&nbsp;
Error_Handling:
<span style="color: #8D38C9; font-weight: bold;">If</span> Err.Description &amp;lt;&amp;gt; <span style="color: #800000;">&quot;&quot;</span> <span style="color: #8D38C9; font-weight: bold;">Then</span> MsgBox Err.Description</pre></div></div>

<p>So there you have it. There won&#8217;t be any pop-up boxes or security alert messages, which can happen when you resort to using the Outlook mail object. CDO simply puts together the email and utilizes your SMTP server connection details to fire off the message. It&#8217;s probably the easiest way I know to incorporate email into Word or Excel VBA scripts.</p>
<p>Here&#8217;s what the message looked like that I received in my inbox.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/outlookvba4.png?323f2c" alt="email from excel" width="346" height="98" /></p>
<p>No hassle &#8211; just the data straight from within the Excel sheet delivered right to my email account. If you&#8217;re creative with how you put together the body string variable with all sorts of data from your Excel sheet, you can just imagine the cool automated email reports that you could put together. And if you don&#8217;t want to use a command button, just have the script run on the sheet or application close event.</p>
<p>Can you think up any cool uses for CDO in your own Excel, Access, or Word projects? Share your thoughts and ideas in the comments section below.</p>
<p><small><a href="http://image.shutterstock.com/display_pic_with_logo/285868/285868,1280383213,6/stock-photo-laptop-and-mail-done-in-d-isolated-58049572.jpg" rel="nofollow">Shutterstock</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.makeuseof.com/tag/send-emails-excel-vba/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>How To Make Your Own Basic Internet Browser Using VBA</title>
		<link>http://www.makeuseof.com/tag/basic-internet-browser-vba/</link>
		<comments>http://www.makeuseof.com/tag/basic-internet-browser-vba/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 21:31:10 +0000</pubDate>
		<dc:creator>Ryan Dube</dc:creator>
				<category><![CDATA[How-To Articles]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[browsing tools]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[DIY]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[visual basic]]></category>

		<guid isPermaLink="false">http://www.makeuseof.com/?p=93685</guid>
		<description><![CDATA[When you really stop to think about it, an Internet browser in its simplest form isn't really that impressive an application. I mean, yes, the Internet is amazing by anyone's standards. The concept of linking so many of the world's computers and mobile devices within this massive network, that is epic. But the concept of transferring a text file with special code in it onto a computer screen is not really a big deal.]]></description>
			<content:encoded><![CDATA[<p><img class="align-right" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/webbrowser.jpg?323f2c" alt="make your own internet browser" />When you really stop to think about it, an Internet browser in its simplest form isn&#8217;t really that impressive an application. I mean, yes, the Internet is amazing by anyone&#8217;s standards. The concept of linking so many of the world&#8217;s computers and mobile devices within this massive network, that is epic. But the concept of transferring a text file with special code in it, and displaying that transferred text onto the computer screen &#8211; that&#8217;s really not a big deal.</p>
<p>In fact, thanks to the embedded references in applications that use VBA, you can input and output webpages via your own applications. If you&#8217;ve followed our past scripting articles, then you know we love VB script and VBA, like my article on <a href="http://www.makeuseof.com/tag/3-ways-open-applications-windows-maximized-vb-script/">maximizing windows</a>, Paul&#8217;s on <a href="http://www.makeuseof.com/tag/how-to-create-self-updating-excel-charts-in-three-easy-steps/">self-updating charts</a>, and Saikat&#8217;s on sending out <a href="http://www.makeuseof.com/tag/how-to-send-mass-emails-with-a-personal-touch-in-outlook/">mass emails</a>.</p>
<p>Using the approach below, you can use Word, Access or Excel to read HTML documents on the web, alter those documents, and then output whatever you want in a new browser window.</p>
<p>It may sound like something that only an experienced VBA programmer can do, but in this article I&#8217;m going to show you how you can do this yourself, starting with a basic procedure to output data from within your own application to a webpage.</p>
<h2>Enabling Microsoft Internet Controls</h2>
<p>The first step, no matter how you want to make use of the ability to input/output your own HTML via VBA, is to enable the Microsoft Internet Controls reference.</p>
<p>In Excel, you do this by clicking on the &#8220;<em>Developer</em>&#8221; menu item, clicking <em>Design Mode</em>, and then clicking on the &#8220;<em>View Code</em>&#8221; button. This may appear different in older versions of Excel, but essentially you need to find where you can launch the VBA code editor.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/vbabrowse1.png?323f2c" alt="make your own internet browser" width="532" height="142" /></p>
<p>In the VBA editor, click on <em>Tools</em>, and then <em>References</em>.</p>
<p style="text-align: center;"><img class="aligncenter" style="border-width: 1px; border-color: black; border-style: solid;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/vbabrowse2.png?323f2c" alt="make an internet browser" width="535" height="266" /></p>
<p>In the References window, scroll all the way down until you see &#8220;<em>Microsoft Internet Controls</em>&#8220;. Check the box and then click &#8220;<em>OK</em>&#8220;.</p>
<p style="text-align: center;"><img class="aligncenter" style="border-width: 1px; border-color: black; border-style: solid;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/vbabrowse3.png?323f2c" alt="make an internet browser" width="449" height="360" /></p>
<p>Now, within your VBA code, you will be able to create objects that can get information off the Internet, and you can output your own HTML documents that the user can view in their own browser.</p>
<h3>Inputting and Outputting HTML</h3>
<p>The first thing that you&#8217;ll want to accomplish here is outputting information to HTML. Think about how much you can do once you can output information to a perfectly formatted HTML webpage. You can extract data from your Excel spreadsheets and output them in a nicely formatted report.</p>
<p style="text-align: center;"><img class="aligncenter" style="border-width: 1px; border-color: black; border-style: solid;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/vbabrowse4.png?323f2c" alt="make an internet browser" width="428" height="318" /></p>
<p>To create this feature, you&#8217;ll need to insert a command button on your sheet. Under the <em>Developer</em> menu, click on <em>Design Mode</em>, and then click the &#8220;<em>Insert</em>&#8221; button. You&#8217;ll see a dropdown of controls that you can add to your sheet.</p>
<p>In this case, click the button control and place it in your sheet. Make sure there&#8217;s some data in the sheet (or any sheet), that you want to output to a report when the button is clicked. Left click on the button to select it and click &#8220;<em>View Code</em>&#8220;.</p>
<p>Enter the following code:</p>
<pre>Sub Button1_Click()</pre>
<pre> Dim objIE As Object</pre>
<pre> Dim HTML As String</pre>
<pre> '----------The HTML CODE GOES FROM HERE AND DOWN----------</pre>
<pre> HTML = "&lt;HTML&gt;&lt;TITLE&gt;HTML Report Page&lt;/TITLE&gt;" &amp; _</pre>
<pre> "&lt;BODY&gt;&lt;FONT COLOR = BLUE&gt;&lt;FONT SIZE = 5&gt;" &amp; _</pre>
<pre> "&lt;B&gt;The Following Are Results From Your Daily Calculation&lt;/B&gt;" &amp; _</pre>
<pre> "&lt;/FONT SIZE&gt;&lt;P&gt;" &amp; _</pre>
<pre> "Daily Production: " &amp; Sheet1.Cells(1, 1) &amp; "&lt;p&gt;" &amp; _</pre>
<pre> "Daily Scrap: " &amp; Sheet1.Cells(1, 2) &amp; "&lt;p&gt;&lt;/BODY&gt;&lt;/HTML&gt;"</pre>
<pre> '----------The HTML CODE GOES HERE AND ABOVE---------</pre>
<pre> On Error GoTo error_handler</pre>
<pre> Set objIE = CreateObject("InternetExplorer.Application")</pre>
<pre> With objIE</pre>
<pre> .Navigate "about:blank"</pre>
<pre> Do While .Busy: DoEvents: Loop</pre>
<pre> Do While .ReadyState &lt;&gt; 4: DoEvents: Loop</pre>
<pre> .Visible = True</pre>
<pre> .Document.Write HTML</pre>
<pre> End With</pre>
<pre> Set objIE = Nothing</pre>
<pre> Exit Sub</pre>
<pre>error_handler:</pre>
<pre> MsgBox ("Unexpected Error, I'm quitting.")</pre>
<pre> objIE.Quit</pre>
<pre> Set objIE = Nothing</pre>
<pre>End Sub</pre>
<p>This code outputs the HTML that you&#8217;ve defined in that output string. As you can see from my example above, you can embed data from any sheet in Excel into your HTML string. Here is the resulting webpage report:</p>
<p style="text-align: center;"><img class="aligncenter" style="border-width: 1px; border-color: black; border-style: solid;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/vbabrowse5.png?323f2c" alt="make your own internet browser" width="580" height="203" /></p>
<p>Now that you have HTML output working, the next step to make your VBA script work virtually like a web browser is to read in HTML from some website, manipulate the data, and then output it into an HTML output page.</p>
<pre>Sub Button1_Click()</pre>
<pre> Dim objIE As Object</pre>
<pre> Dim HTML As String</pre>
<pre> On Error GoTo error_handler</pre>
<pre> Set objIE = CreateObject("InternetExplorer.Application")</pre>
<pre> With objIE</pre>
<pre> .Navigate "http://www.google.com"</pre>
<pre> Do While .Busy: DoEvents: Loop</pre>
<pre> Do While .ReadyState &lt;&gt; 4: DoEvents: Loop</pre>
<pre> .Visible = True</pre>
<pre> HTML = objIE.Document.Body.innerHTML</pre>
<pre> .Document.Write "&lt;html&gt;&lt;title&gt;My Own Google Results!&lt;/title&gt;&lt;body&gt;&lt;h1&gt;This is an Edited Version of the Google Page!&lt;/h1&gt;" &amp; HTML &amp; "&lt;/body&gt;&lt;/html&gt;"</pre>
<pre> End With</pre>
<pre> Set objIE = Nothing</pre>
<pre>Exit Sub</pre>
<pre>error_handler:</pre>
<pre> MsgBox ("Unexpected Error, I'm quitting.")</pre>
<pre> objIE.Quit</pre>
<pre> Set objIE = Nothing</pre>
<pre>End Sub</pre>
<p>What I&#8217;ve done here is used the IE object to read HTML from Google into a text variable in VBA called HTML. I then placed my own HTML output text in the top of the page, and then outputted the same HTML to the VBA HTML output. This is what that looks like:</p>
<p style="text-align: center;"><img class="aligncenter" style="border-width: 1px; border-color: black; border-style: solid;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/vbabrowse6.png?323f2c" alt="" width="503" height="351" /></p>
<p>This is a very basic example of what this is capable of. But if you think about it, once you have the HTML from a webpage loaded into your VBA string variable, you can search for specific lines in the page, look for images, search out email addresses of phone numbers &#8211; or you could rewrite the entire input page into a new, edited version of the same page in whatever format you like and with any modifications you like.</p>
<p>Doing this would require a bit of string manipulation prowess &#8211; but nothing is impossible once you&#8217;ve read in the HTML source from the web.</p>
<p>Do you see any potential for using either HTML input or output in your own applications? Can you think of any cool uses for this script? Share your thoughts in the comments section below.</p>
<p><small>Image credit: <a href="http://image.shutterstock.com/display_pic_with_logo/172762/172762,1245276291,1/stock-photo-www-and-web-browser-in-blue-tone-32231746.jpg" rel="nofollow">Shutterstock</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.makeuseof.com/tag/basic-internet-browser-vba/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Create A Freaky Possessed Computer With Windows Script For Halloween</title>
		<link>http://www.makeuseof.com/tag/create-possessed-computer-windows-script/</link>
		<comments>http://www.makeuseof.com/tag/create-possessed-computer-windows-script/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 16:01:50 +0000</pubDate>
		<dc:creator>Ryan Dube</dc:creator>
				<category><![CDATA[Cool Windows Apps & Tricks]]></category>
		<category><![CDATA[halloween]]></category>
		<category><![CDATA[jokes]]></category>
		<category><![CDATA[prank]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[visual basic]]></category>
		<category><![CDATA[windows tips]]></category>

		<guid isPermaLink="false">http://www.makeuseof.com/?p=90586</guid>
		<description><![CDATA[There are a lot of fun pranks you can play on your friends with a computer. You've probably seen all of those creepy YouTube videos that people forward to each other for a good scare. Not long ago, Justin covered a few really funny ways to prank your parents with a computer too. All of those ideas are fun, but this year, how about creeping out your friends a bit with your very own programming skill?]]></description>
			<content:encoded><![CDATA[<p><img class="align-right" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/10/phantomtype.png?323f2c" alt="typing ghost" />There are a lot of fun pranks you can play on your friends with a computer. You&#8217;ve probably seen all of those creepy <a href="http://www.makeuseof.com/tag/14-popular-youtube-pranks-play-friends/">YouTube videos</a> that people forward to each other for a good scare. Not long ago, Justin covered a few really funny ways to <a href="http://www.makeuseof.com/tag/four-funny-ways-to-prank-your-parents-with-the-family-computer/">prank your parents</a> with a computer too. All of those ideas are fun, but this year, how about creeping out your friends a bit with your very own programming skill?</p>
<p>In this article, I&#8217;m going to show you how you can create your own little Windows script that will run on just about any modern Windows computer. All you have to do is open up Notepad, type up this script, save it as a .wsf file and then have your friends open up the file. The script will automatically open up Notepad and then start typing &#8211; complete with typewriter sound effects &#8211; just like the computer itself is possessed by a typing ghost.</p>
<p>The real beauty of this little script is how creative you are with launching it. Insert it into the computer&#8217;s startup folder so it launches when the computer starts, or replace one of their favorite desktop shortcuts to link to your file instead of their application!</p>
<h2>Scripting A Possessed Typing Computer</h2>
<p>The idea for this came from an experience at college, when I walked past a professor&#8217;s office and saw that he had an old DOS computer that was typing all by itself. He was a Computer Science professor, and he&#8217;d clearly written a DOS program that could type all by itself, complete with sound effects, pauses and everything. Very authentic. In this article, you&#8217;re going to do the same thing, just with Windows and using VB Script to accomplish the job. I&#8217;ll walk you through the process.</p>
<p>First step &#8211; download a typewriter WAV file from any of your favorite <a href="http://www.makeuseof.com/dir/soundbible-wav-sounds-free-to-download/">free WAV file websites</a>.</p>
<p style="text-align: center;"><img class="aligncenter" style="border-width: 1px; border-color: black; border-style: solid;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/10/typing1.png?323f2c" alt="typing ghost" width="563" height="433" /></p>
<p>Preferably download one that lasts from 30 seconds to a minute, depending on how much text you want your phantom app to type on the screen by itself. Save the file to <em>c:/windows/Media/</em> with the rest of the Windows sound files so it&#8217;ll be easy to find later.</p>
<p style="text-align: center;"><img class="aligncenter" style="border-width: 1px; border-color: black; border-style: solid;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/10/typing2.png?323f2c" alt="" width="536" height="390" /></p>
<p>Next, open up a text file and save it as a .wsf file. In my case I called it &#8220;<em>phantomtype.wsf</em>&#8220;. Declare all of the required variables, set up your text file link and then type the text that you want your typing ghost app to type on the screen.</p>
<p>&nbsp;</p>
<pre>&lt;job&gt;
&lt;script language="VBScript"&gt;
Option Explicit
On Error Resume Next

Dim NoteShell
Dim SoundShell
Dim strText
Dim intTextLen
Dim x
Dim intPause
Dim strTempText

strSoundFile = "C:\Windows\Media\typewriter1.wav"

strText = "Hello. My name is Ryan. I have possessed your computer</pre>
<pre>and there is nothing you can do about it. Of course, I suppose you</pre>
<pre>can always close the window if you want to, but that wouldn't be any fun!"</pre>
<p>&nbsp;</p>
<p>Pretty simple so far right? The two &#8220;Shell&#8221; variables are basically the shell commands that are going to launch Notepad and your sound file. The phantom typing will come from your script sending keystrokes to the Notepad app behind the scenes. Accomplishing that is easy &#8211; you just use &#8220;CreateObject&#8221; to set up your two application objects, and then launch each app, waiting a tiny bit between each launch.</p>
<p>&nbsp;</p>
<pre>Set NoteShell = CreateObject("WScript.Shell")
Set SoundShell = CreateObject("Wscript.Shell")

NoteShell.Run "notepad"
WScript.Sleep 1000

SoundShell.Run "C:\Windows\Media\typewriter1.wav", 0, True
WScript.Sleep 500</pre>
<p><span style="font-family: monospace;"><br />
</span></p>
<p>Now, the victim will see Notepad pop up on the screen, and after a second, the typewriter typing sound will start. At that moment, you will start sending ghostly text to the screen, just like someone is sitting there typing. Here&#8217;s how that part works.</p>
<p>&nbsp;</p>
<pre>intTextLen = Len(strText)
intPause = 100

For x = 1 to intTextLen
	strTempText = Mid(strText,x,1)
	NoteShell.SendKeys strTempText

	WScript.Sleep intPause

	If intPause &lt;= 500 Then
		intPause = intPause + 100
	Else
		intPause = 100
	End If
Next</pre>
<p><span style="font-family: monospace;"><br />
</span></p>
<p>This may look complicated, but don&#8217;t worry, it&#8217;s not at all. The first line checks the length of the long string of text that you typed up at the start of this program. That&#8217;s the text that you want to magically appear &#8211; one letter at a time &#8211; on the screen. The next line creates a starting pause (a tenth of a second) between each typed letter.</p>
<p>The For loop that you see below that basically starts at position 1, extracts a single letter from your text, sends that letter to Notepad, and then waits a little bit before moving forward to the next letter in your text. Pretty cool huh?</p>
<p>And to keep things authentic, the little &#8220;IF&#8221; statement keeps adding and subtracting pause time between typed letters to make the whole thing look really authentic, like someone is sitting right there typing.</p>
<p>Now close up the script.</p>
<pre>WScript.Quit
&lt;/script&gt;
&lt;/job&gt;
</pre>
<p>Save the file again &#8211; making sure you&#8217;ve got the &#8220;wsf&#8221; extension &#8211; and you&#8217;re done. Double click the file and check out your haunted computer!</p>
<p>Here&#8217;s my script in action (I wish you could hear the typing sounds, it&#8217;s a riot!)</p>
<p style="text-align: center;"><img class="aligncenter" style="border-width: 1px; border-color: black; border-style: solid;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/10/typing3.png?323f2c" alt="typing ghost" width="420" height="253" /></p>
<p>Like most programs, it could use a little perfecting if you&#8217;re up to it. The sound file needs to match the amount of time it takes for the typing to finish. Or, you could loop both the typing and the sound, but you&#8217;ll need to come up with a way to let the person close the typing ghost application. If you don&#8217;t, the &#8220;sendkeys&#8221; will just continue typing no matter what window they open&#8230;which, is actually a pretty funny virus-like behavior, but not something that I would recommend you do to your friends.</p>
<p>So give this creepy little script a try and let us know what your friends thought about it. Did you come up with any other ways to perfect it? Share your thoughts in the comments section below.<br />
<small></small></p>
<p><small>Image Credit : <a href="http://image.shutterstock.com/display_pic_with_logo/208936/208936,1287452408,1/stock-photo-a-young-woman-experiences-the-horror-of-what-he-saw-on-the-internet-63277774.jpg" rel="nofollow">Shutterstock</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.makeuseof.com/tag/create-possessed-computer-windows-script/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>4 Great Websites To Make You A Visual Basic Guru</title>
		<link>http://www.makeuseof.com/tag/4-great-websites-to-make-you-a-visual-basic-guru/</link>
		<comments>http://www.makeuseof.com/tag/4-great-websites-to-make-you-a-visual-basic-guru/#comments</comments>
		<pubDate>Sun, 31 May 2009 23:00:09 +0000</pubDate>
		<dc:creator>Ryan Dube</dc:creator>
				<category><![CDATA[Cool Windows Apps & Tricks]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[visual basic]]></category>

		<guid isPermaLink="false">http://www.makeuseof.com/?p=18325</guid>
		<description><![CDATA[For the first few years of my engineering career, I spent a lot of time writing Visual Basic based GUI applications for automated factory machines. These were the sort of VB applications that were very difficult to test, because for the most part the users consisted of moderately educated folks who had a hard time [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-18340" style="border: 10px solid white;" title="bitsandbytes" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2009/05/bitsandbytes.jpg?323f2c" alt="bitsandbytes" width="225" />For the first few years of my engineering career, I spent a lot of time writing <a href="http://en.wikipedia.org/wiki/Visual_Basic">Visual Basic</a> based GUI applications for automated factory machines. These were the sort of VB applications that were very difficult to test, because for the most part the users consisted of moderately educated folks who had a hard time using a mouse, let alone clicking on the screen and entering information. Inevitably, no matter how much I tested these applications, one of these operators would do <em>something</em> that would bring the application crashing to its knees. Very quickly, I learned the value of reusing thoroughly tested Visual Basic code. Otherwise, if you start from scratch every time, you&#8217;re bound to make new mistakes all over again.</p>
<p>In time, I learned to significantly speed up my own Visual Basic programming by working in a more modular format &#8211; utilizing components that I either wrote myself or downloaded off of reliable source code websites. I really started to appreciate those folks who spend time writing up a VB component that performs a specific function, and then offer that code for absolutely free to other developers. In the course of my work &#8211; these selfless developers were saints. Today I&#8217;d like to offer up some of those resource websites to MUO readers who are also VB developers.<br />
<span id="more-18325"></span><br />
<strong>Finding the Best Websites for Visual Basic Examples</strong></p>
<p>Whenever you need to create a particular function or add a feature to your application, don&#8217;t start from scratch &#8211; just sift through the visual basic examples at these websites, download the ones you want and then customize them to suit your needs.  A while back I wrote an article on the <a href="http://www.makeuseof.com/tag/top-10-professional-sample-code-websites-for-programmers/" target="_blank">top professional sample code websites for programmers</a>. Many of those are invaluable resources for the VB programmer, such as Planet-Source-Code and DevX.  David also wrote a great article on <a href="http://www.makeuseof.com/tag/learn-to-code-at-any-level-with-google-code-university/" target="_blank">Google Code University</a>, where you can learn to write in different coding languages. However, what I&#8217;d like to focus on in this article are resources tailored specifically for Visual Basic programmers and for the sort of programming that they do.</p>
<p><strong>VBCode &#8211; Visual Basic Code Snippets and Files</strong></p>
<p><a href="http://www.vbcode.com/" target="_blank">VBCode</a> is a valuable, constantly updated resource featuring hundreds of VB code examples. In choosing the best sites, I evaluated the site based on not only the volume of free VB code, but also layout and ease of use. If it takes hours to locate the code sample that you need, the site won&#8217;t be very useful. The great thing about VBCode is that it&#8217;s wonderfully organized into 10 general categories such as Internet and Music/Sounds. You can also search the entire database for keyword phrases that describe what the code snippet does. The website currently holds over 10,000 lines of sample code, and that number rises every month.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-18326" style="border: 1px solid black;" title="vbcode" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2009/05/vbcode.png?323f2c" alt="vbcode" width="495" height="370" /></p>
<p style="text-align: left;">On the left menu bar at this website, there&#8217;s a &#8220;popular code&#8221; category, which I love to search through &#8211; you never know what kind of code snippet you&#8217;ll find. For example, a quick review just now turned up source code that lets you:</p>
<ul>
<li>Make a form transparent</li>
<li>Code you can use to check your email</li>
<li>How to produce &#8220;movie&#8221; like credits that scroll</li>
</ul>
<p><strong>A1 VB Code &#8211; Visual Basic Code, Forums and More</strong></p>
<p><a href="http://www.a1vbcode.com/" target="_blank">A1 VB Code</a> is a pretty cool Visual Basic coding community that features thousands of Visual Basic examples. The code here covers VB and VB.NET as well as ASP and ASP.NET. The code here is sorted into 22 categories, including databases, game programming, XML and Internet Programming just to name a few. My favorite is usually the &#8220;Controls&#8221; section, because they&#8217;re so easy to integrate into existing source code and usually very easy to customize.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-18328" style="border: 1px solid black;" title="a1vbcode" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2009/05/a1vbcode.png?323f2c" alt="a1vbcode" width="550" /></p>
<p style="text-align: left;">At A1 VB Code you&#8217;ll also find a fairly active forum where you can ask questions or discuss code. This website on it&#8217;s own would be more than enough of a resource to keep any VB programmer satisfied. If you can&#8217;t find what you need and you&#8217;re having a hard time coding it yourself, you&#8217;re sure to find someone in the forums who&#8217;s willing to lend you a hand.</p>
<p><strong>Andrea VB &#8211; Programming &amp; Downloads</strong></p>
<p>One of the best VB resources I&#8217;ve found is <a href="http://www.andreavb.com/" target="_blank">Andrea VB</a>, an enormous resource created in 1999 by Andrea Tincani, and filled with just about anything related  to Visual Basic that you could imagine. A better description for this website would be a VB <em>portal</em>, offering a popular forum, articles and tutorials, news and links as well as really useful source code examples and downloads. My favorite section of this site that I&#8217;ve used often is the API Calls List under the Source Code section. These API calls aren&#8217;t alway seasy to find, and AndreaVB has a whole section devoted to them.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-18330" style="border: 1px solid black;" title="andrea" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2009/05/andrea.png?323f2c" alt="andrea" width="550" /></p>
<p style="text-align: left;">The main page of the site does at first come across as very busy, but that&#8217;s only because the website is chock-full of valuable resources. In addition to the huge source code section, there&#8217;s also the download section that features full application source code under some pretty cool categories like Bluetooth, E-Books and Visual Basic Games. For anyone who likes to push VB to its limits and step a bit outside the box &#8211; this website is like a big playground.</p>
<p><strong>VB Accelerator</strong></p>
<p>The <a href="http://www.vbaccelerator.com/home/VB/Code/index.asp" target="_blank">VB Accelerator</a> website is actually pretty well named. Unlike Andrea VB, VB Accelerator focuses on the bread and butter of VB &#8211; the old meat and potatoes core functionality such as standard controls and common libraries and techniques that even old school programmers forget how to do occasionally. This is especially useful for folks who didn&#8217;t bother to purchase the Library CDs where you can look up many of the VB functions and syntax. This site provides you with a resource to go to whenever you need to look up things like how to program Combo and List Boxes, or how to set up a TreeView.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-18335" style="border: 1px solid black;" title="vbaccel" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2009/05/vbaccel.png?323f2c" alt="vbaccel" width="491" height="423" /></p>
<p style="text-align: left;">The simplicity of the index on the main page betrays the depth of this website. Once you start drilling down through the directories within each folder, you&#8217;ll discover a seemingly unlimited supply of Visual Basic examples, like this page I found on writing CDs.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-18337" style="border: 1px solid black;" title="vbaccl2" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2009/05/vbaccl2.png?323f2c" alt="vbaccl2" width="550" /></p>
<p>For the most part, these websites are only the very tip of the iceberg. Today, Visual Basic remains one of the most popular programming languages &#8211; with websites and programmer communities producing more lines of code and within more industries than any other applications programming language in the world.</p>
<p>Are you a VB guru? And if so, do you have any favorite resources or online communities where you go to get programming advice or Visual Basic examples? Share them in the comments section below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.makeuseof.com/tag/4-great-websites-to-make-you-a-visual-basic-guru/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Top 10 Professional Sample Code Websites For Programmers</title>
		<link>http://www.makeuseof.com/tag/top-10-professional-sample-code-websites-for-programmers/</link>
		<comments>http://www.makeuseof.com/tag/top-10-professional-sample-code-websites-for-programmers/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 15:01:02 +0000</pubDate>
		<dc:creator>Ryan Dube</dc:creator>
				<category><![CDATA[MakeUseOf Lists]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[visual basic]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[webdesign]]></category>
		<category><![CDATA[webmaster tools]]></category>

		<guid isPermaLink="false">http://www.makeuseof.com/?p=12640</guid>
		<description><![CDATA[Most programmers are not just desktop programmers, web programmers or scripting gurus &#8211; they are often all of the above. Over time, most software developers find that it&#8217;s much easier to re-use code components than it is to recreate the wheel every time you write an application.  Over time, these developers typically archive a library of [...]]]></description>
			<content:encoded><![CDATA[<p><img style="margin-right:20px" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2009/02/greensphere1.jpg?323f2c" border="0" alt="" vspace="10" width="213" height="213" align="left" />Most programmers are not <em>just</em> desktop programmers, web programmers or scripting gurus &#8211; they are often <strong>all</strong> of the above. Over time, most software developers find that it&#8217;s much easier to re-use code components than it is to recreate the wheel every time you write an application.  Over time, these developers typically archive a library of these reusable modules in order to save time the next time they need to do the same task.</p>
<p>Now, thanks to the power of the Internet, there is a proliferation of websites where professional programmers offer these modules to the general public for absolutely free. For other application developers, these libraries are a goldmine.  Whether you write in VB, C, C++, C#, Perl, PHP, Ruby, or any other programming language, there&#8217;s a website out there where you can find such reusable sample code.</p>
<h2><strong>Choosing the Top Websites for Sample Code</strong></h2>
<p>Every developer has a list of their favorite websites where they not only search for free sample code, but they also take part in the developer community that exists at these sites.  Programmers often develop a very passionate attachment to some of these websites.</p>
<p>The following is, by no means, an exhaustive list of the best developer websites online.  Such a list would be difficult, since there are thousands of excellent resources throughout the net. The following is simply a list of ten of the best places to <em>start</em> if you&#8217;re looking for high quality sample code.  So please, folks, no food fights if your favorite isn&#8217;t mentioned. The following websites are listed in no particular order.</p>
<h3>#1 &#8211; Programmer&#8217;s Heaven</h3>
<p><a href="http://www.programmersheaven.com/" target="_blank">Programmer&#8217;s Heaven</a> is a huge online resource that is very much a community of many different programmers.  The site includes information, tips, and forums on languages like Basic, C++, Delphi, Java, Perl, PHP, Python, Ruby, Visual Basic and more. You can also search the site by application or platform.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2009/02/1-programmers-heaven.jpg?323f2c" alt="sample code website" /></p>
<p>Programmer&#8217;s Heaven has forums, blogs, articles, files, links and news for every single programming language listed on the site.  The size of this website is impressive, and the community is growing quickly into one of the largest developer communities on the net.</p>
<p>If you need sample code that&#8217;s not already on the site, just ask for help in the forums.</p>
<h3><strong>#2 &#8211; SourceForge.net</strong></h3>
<p>It goes without saying that <a href="http://sourceforge.net/">SourceForge</a> is one of the most significant open source communities on the Internet.  When you need to review sample code to learn how to do something, this is a great place to search.</p>
<p>From the main page, just click &#8220;Find Software,&#8221; and then &#8220;Development.&#8221;  The next page will astound you. You&#8217;ll discover an entire world of open source projects.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2009/02/2-source-forge.png?323f2c" alt="sourceforge" /></p>
<p>You read that right, that&#8217;s over <strong>54,000</strong> listings under &#8220;Software Development.&#8221;  If you find a software project that sparks your interest, and you can see how the software could be greatly improved, you might consider joining up with one of the many open source projects.</p>
<p>See the <a href="http://apps.sourceforge.net/trac/sitedocs/wiki/Overview%20of%20Open%20Source%20software%20development" target="_self">SourceForge</a> overview for how this works. Open source is a way of life, and these coders take it very seriously.</p>
<h3><strong>#3 &#8211; CodeGuru</strong></h3>
<p><a href="http://www.codeguru.com" target="_blank">CodeGuru</a> is also a cool site for developers. It mostly covers just Visual C++/C++, .Net/C# and Visual Basic. While this isn&#8217;t a huge selection of programming languages, the site is filled with articles that are far more comprehensive than your standard short forum posts that you find at other websites. CodeGuru offers useful explanations of how to accomplish specific tasks.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2009/02/3-code-guru.png?323f2c" alt="sample coding asp.net" /></p>
<p>The example above is an article on how to load images from or save images to a database using Visual Basic. The article has quality screenshots and well written sample code.</p>
<h3><strong>#4 &#8211; The Code Project</strong></h3>
<p><a href="http://www.codeproject.com/" target="_blank">CodeProject</a> is a booming developer community that&#8217;s organized very much like a free article directory website, except in this case the content producers are actually programmers who are trying to provide the best programming articles available.  Most of these come complete with well written explanations along with the sample code.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2009/02/4-code-sample-project.png?323f2c" alt="the code project" /></p>
<p>The Code Project isn&#8217;t your run-of-the-mill resource where you&#8217;ll sift through the site for the code you need and then run. You&#8217;re likely to get sucked into the many prize competitions, surveys, articles, message boards, or even the job board. This community is a lot of fun and a good way to connect with other programmers with common coding interests. Before you know it, you may be tempted to write an article yourself!</p>
<h3><strong>#5 &#8211; DevX</strong></h3>
<p>No list of developer resources would be complete without a mention of <a href="http://www.devx.com" target="_blank">DevX</a>. This site is a massive programmer&#8217;s paradise &#8211; a huge portal to other huge sites covering the most popular programming topics such as Java, C++, Database programming, Visual Basic, Mobile programming and much more.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2009/02/5-devx.png?323f2c" alt="devx- sample code vb.net" /></p>
<p>Running your mouse over the left menu bar, as shown above, will display the sub-communities that exist under the DevX umbrella portal. When I had a significant Visual Basic project to complete in 2001, this website quickly became my home away from home.</p>
<h3>#6 &#8211; Planet Source Code</h3>
<p><a href="http://www.planet-source-code.com/" target="_blank">Planet-Source-Code</a> is one of those websites that you hate to like, but you need it anyway. It&#8217;s horribly designed, with a weird tiny-font menu listing at the top and ads splattered throughout the page, but if you know where to click, you&#8217;ll find a <em>huge</em> library of very useful sample code. At the top right where it reads &#8220;To start, just choose:&#8221; select the programming language of your choice. The site covers most of the major languages. On the next page you&#8217;ll see many categories of sample code to choose from.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2009/02/6-planet-source-code.png?323f2c" alt="sample code in java" /></p>
<p>Most of the languages have search filter options, and as you can see here, each category has tens, and even hundreds of thousands of lines of sample code available.</p>
<h3><strong>#7 &#8211; GNU and The Free Software Directory</strong></h3>
<p>If your thing is Open Source, then you can&#8217;t miss out on the <a href="http://directory.fsf.org/GNU/" target="_blank">Free Software Directory</a> that&#8217;s linked directly from the GNU home page. This directory is just an impressive list of free software within categories like audio and video, database, email, games, graphics, Internet apps, communications and much more.</p>
<h3><strong>#8 &#8211; Google Code</strong></h3>
<p>Google has also joined the open source crowd with <a href="http://code.google.com/more/#products-products-android" target="_blank">Google Code</a>, a site that offers mostly web based sample code within categories like browser apps, website ads, product APIs, and social networking apps.</p>
<p>Google Code received a honorary mention in the MakeUseOf article &#8220;<a href="http://www.makeuseof.com/tag/10-google-services-that-get-no-love/" target="_blank">10 Google Services that Get No Love</a>,&#8221; by Mark.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2009/02/8-google-code.png?323f2c" alt="google code" /></p>
<p>As always, Google uses its standard format &#8211; a very clean and easy to use website where you&#8217;ll have no problem quickly finding exactly the open source code that you need.</p>
<h3><strong>#9 &#8211; DevelopersDex</strong></h3>
<p><a href="http://www.developersdex.com/" target="_blank">DevelopersDex</a> is another developers community that has rewarded some of the highest quality contributors with &#8220;guru&#8221; status.  The site is essentially a giant developer&#8217;s forum, currently approaching just under 50 thousand members. The site covers ASP, C#, SQL, VB, and XML.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2009/02/9-developers-dex.png?323f2c" alt="" /></p>
<p>Each programming category features complete subcategories such as FAQs, job directories, news, and of course forums and newsgroups.</p>
<p>If you&#8217;re a developer using one of these languages and you&#8217;re looking for a massive web portal to browse through, this is a good one.</p>
<h3><strong>#10 &#8211; DevArticles</strong></h3>
<p>Saving one of my favorites for last, <a href="http://www.devarticles.com" target="_blank">DevArticles</a> offers one of the most comprehensive directories of articles offering sample codes on the Internet.  The list of available software categories is astonishing, including like Flash, embedded tools, and even mobile Linux.</p>
<p>Clicking on any one of those categories turns up a list of useful articles complete with sample code and full descriptions.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2009/02/10-dev-articles.png?323f2c" alt="sample code dev articles" /></p>
<h2><strong>Is There More?</strong></h2>
<p>This list of developer resources that offer quality sample code snippets is nowhere near complete.  The internet is chock full of resources, and everyone has a list of personal favorites, which often depends heavily upon which software languages you prefer, and what type of programming you&#8217;re doing.</p>
<p>Are you a regular visitor to any of the websites listed above when you&#8217;re looking for sample code?  Do you have any personal favorites that aren&#8217;t listed here?  Share your own favorite sample code resources in the comments section below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.makeuseof.com/tag/top-10-professional-sample-code-websites-for-programmers/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached (Requested URI is rejected)
Database Caching 1/17 queries in 0.039 seconds using apc
Object Caching 569/602 objects using disk: basic
Content Delivery Network via main.makeuseoflimited.netdna-cdn.com

Served from: www.makeuseof.com @ 2012-02-10 21:29:07 -->
