Get the crisp of what I....

I brief here what I See , what I Read, what I Know, what I Hear. And remember this is my view. No offenses meant.

Tuesday, December 12, 2006

Kinda technical stuff...

Ever thought of Merlin greeting you when you open your outlook. Here it is..
Open Outlook and go to Tools> Macro>Visual Basic Editor

Add the Microsoft Agent Control 2
.0 as reference

Go to This Outlook Session and paste the following code.

Public Sub Application_Startup()

Dim strMorning As Date

Dim strNoon As Date

Dim strEvening As Date
Dim strNight As Date

Dim strNow As Date

strNow = Format(Now, "hh:MM:ss AM/PM")

strMorning = Format("7AM", "hh:MM:ss AM/PM")

strNoon = Format("12PM", "hh:MM:ss AM/PM")
strEvening = Format("4.30PM", "hh:MM:ss AM/PM")

strNight = Format("8.00PM", "hh:MM:ss AM/PM")

Set agentMerlin = New Agent

With agentMerlin ' Load a character
.Characters.Load "merlin", "c:\windows\msagent\chars\merlin.acs" 'If the folder ''c:\winNT\msagent\chars\ is not present on your disk, create such a folder and save ''merlin.acs to that folder
'' Display the character
.Characters("merlin").MoveTo 0, 0
Select Case True

Case strNow >= strMorning And strNow < style="font-style: italic;">.Characters("merlin").Speak "Good morning Senthil. Had ur breakfast"
Case strNow >= strNoon And strNow
.Characters("merlin").Speak "Good afternoon. Hope u had a nice lunch"

Case strNow >= strEvening And strNow .Characters("merlin").Speak "Still working. Then go for a break - i mean coffee/tea!!!!!!"
Case strNow >= strNight And strNow
.Characters("merlin").Speak "Had ur dinner. Nowadays u work very hard. Take care of ur health dude"

End Select


End With
End Sub

Save and close the window. Now go to Tools>Macro>Security and select Low security level to run your macro.

That’s it. Now you see when you open the Outlook, you will greetings as this….

No comments: