Thursday, July 20, 2006

Outlook Macro source code

This post is created only for the code, so that I can keep updating it.
The instructions are in other posts.
I do not take credit for this code. Original code for Attachment reminder available here. I merely combined this with Reminder for missing subject. Similar code is available easily just by Googling.

*Update: Outlook counts files used in Signatures as attachments. see here.


Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim strSubject As String
Dim m As Variant
Dim strBody As String
Dim intIn As Integer, intAttachCount As Integer
Dim x As Integer

intAttachCount = 0

strBody = LCase(Item.Body)
intIn = InStr(1, strBody, "original message")
If intIn = 0 Then
intIn = Len(strBody)
intIn = InStr(1, Left(strBody, intIn), "attach")
If intIn > 0 Then

For x = 1 To Item.Attachments.Count
If LCase(Item.Attachments.Item(x).DisplayName) <> "picture (metafile)" Then
intAttachCount = intAttachCount + 1
End If
Next

If intAttachCount = 0 Then

m = MsgBox("It appears that you mean to send an attachment," & vbCrLf & "but there is no attachment to this message." & vbCrLf & vbCrLf & "Do you still want to send?", vbQuestion + vbYesNo + vbMsgBoxSetForeground)

If m = vbNo Then
Cancel = True
Exit Sub
End If
End If
End If
End If

strSubject = Item.Subject
If Len(Trim(strSubject)) = 0 Then
Prompt$ = "Subject is Empty. Are you sure you want to send the Mail?"
If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check for Subject") = vbNo Then
Cancel = True
End If
End If

End Sub


Read more!

Tuesday, July 18, 2006

Ginko: Quick note taking with Outlook

I came across this really neat tool for quick note taking. It is called Ginko (after Ginko Biloba which is memory enhancer herb)

I had downloaded it earlier, gave it a try and realized that I am not using it the way it ti to be used, so I stopped using it for few months. Then after a while I really need to create a @TODO folder in Outlook so that I can track my action items. I started moving the emails which required some action from my side into this folder. But quickly I realized that there are action items originating outside the emails. I had thought of writing an email and send it to myself,that is when I remembered that I know of a tool which does exactly same thing.

But I couldn't remember the name of the application, so I searched my machine using X1, trusty desktop search engine. After couple of combinations of search terms, I was able to find it in my download folder. Rest was easy. I had used it earlier, so I knew I needed to edit the .hta file to point it to correct Folders. As soon as I was done, I was able to jot down the next TODO item. It was that easy.

More about this tool at the author's page here.

Read more!