Saving Outlook E-mail Attachments To a Folder

I was looking for some code samples as I wanted to save e-mail attachments to a folder. Below is the code I got from I modified it a bit as I did not want to touch the original e-mails...

In Outlook, hit Alt+F11, double click modules and paste it into module1
Sub SaveSelectedAttachment()

Dim myItems, myItem, myAttachments, myAttachment As Object
Dim myOrt As String
Dim myOlApp As New Outlook.Application
Dim myOlExp As Outlook.Explorer
Dim myOlSel As Outlook.Selection

'Ask for destination folder
myOrt = InputBox("Destination", "Save Attachments", _

On Error Resume Next

'work on selected items
Set myOlExp = myOlApp.ActiveExplorer
Set myOlSel = myOlExp.Selection

'for all items do...
For Each myItem In myOlSel

'point on attachments
Set myAttachments = myItem.Attachments

'if there are some...
If myAttachments.Count > 0 Then

'add remark to message text
' myItem.Body = myItem.Body & vbCrLf & _
' "Removed Attachments:" & vbCrLf

'for all attachments do...
For i = 1 To myAttachments.Count

'save them to destination
myAttachments(i).SaveAsFile myOrt & _

'add name and destination to message text
' myItem.Body = myItem.Body & "File: " & myOrt & _
' myAttachments(i).DisplayName & vbCrLf

Next i

'for all attachments do...
' While myAttachments.Count > 0

'remove it (use this method in Outlook XP)
'myAttachments.Remove 1

'remove it (use this method in Outlook 2000)
' myAttachments(1).Delete

' Wend

'save item without attachments
' myItem.Save
End If


'free variables
Set myItems = Nothing
Set myItem = Nothing
Set myAttachments = Nothing
Set myAttachment = Nothing
Set myOlApp = Nothing
Set myOlExp = Nothing
Set myOlSel = Nothing

End Sub

I have also seen a lot of useful code examples here

Google Cheat Sheets

I came across this pretty useful site. All cheats can be downloaded as a pdf document... "This two page Google Cheat Sheet lists all Google services and tools as well as background information. The Cheat Sheet offers a great reference to grasp of basic to advance Google query building concepts and ideas."


Bike Tour & World's Strongest Dad

I am going to join company bike team of "The 2006 MS Bike Tour" that will take place on October 15th in Manhattan.

One of the organizers has sent this motivational "no-dry eyes" story to our distribution list. It tells us about the unbelievable story of Dick & Rick Hoyt. This is a must-read!


Tiny Linux gadget protects Windows XP laptops

An Israeli startup has announced a tiny, Linux-based remote access device that aims to protect Windows XP laptops. The credit card-sized device runs sophisticated firewall, VPN, and monitoring software on a hardened Linux kernel.

read more | digg story

How XGL Works

Xgl, Xegl, Xglx, Aiglx... ever wondered what all this stuff does? Here's the definitive layman's guide to understanding how this stuff actually works. Scroll to the end for some illustrative diagrams.

read more | digg story

Dapper Drake to Edgy Eft Upgrade

Being an impatient guy I am, I wanted to upgrade my Dapper Drake Linux boxes to the newest Edgy Eft, which is still in test phase and will be available next month.

I tried upgrades on two systems. Both got stuck. One complained about Firefox packages, other one supsys (this is related to printing system). After trying for hours to repair/uninstall/reinstall the packages, none were able to even boot properly. So, I gave up...

I decided to do a clean install by downloading the Edgy Eft Knot 3 CD. Installation went fine. There was 400Megs of upgrade afterwards. I am yet to screen resolution and test it...

[UPDATE - 09/27/2006]
As I mentioned above, the CD installation was fine on one of my PCs; however, it did not go so well for the other one. I wiped out the harddrive and tried to install Edgy Eft from scratch using the Knot 3 CD. It would just get stuck at some point no matter how many times I tried.

It seemed to finish installation once but then when I rebooted, I saw a *GRUB 18 error * which implies a bios issue... Anyway, I used Dapper Drake Live CD to install 6.06 and then on vanilla install just replaced all the "dapper" references in /etc/apt/sources.list to "edgy". In "vi" you can easily do this:
Upgrade still failed and it complained about Firefox... As suggested, I ran
sudo apt-get -f install
to fix the issues. It worked (or so it seemed). Then I re-ran
sudo apt-get update && sudo apt-get dist-upgrade -y
and installation finished. After reboot X-Server did not come up. Everything in /etc/X11/xorg.conf made sense to me. So, I tried running reconfiguration command
sudo dpkg-reconfigure -phigh xserver-xorg
but that would not work either as xserver-xorg was "broken". I, then, reinstalled xserver-xorg package:
sudo apt-get --reinstall install xserver-xorg
That seemed to do the trick as GUI came up when I ran
/etc/init.d/gdm restart
This is being a painful upgrade but hey I asked for it, did not I?


112 Windows Run Commands

Wanted to Browse fast in windows. Remember these commands.
This will really save a lot of time of your. There are many
commands which you might have never seen or never knew.
There are certain properties of windows which you may hardly know
exist in windows. Here is a list of 112 run commands.

BTW, In case you did not know, you can quickly access Start > Run by using WindowsKey + R combination. (Windows Key is usually between Ctrl & Alt and has Windows Logo on it).

read more | digg story

Worlds worst hacker (hacks

This is a transcript of the worlds dummest hacker on an IRC channel. Prepare to roll on the floor :)

read more | digg story