Archive button in Outlook (like gmail)

So this is the working solution that i finally put together for my self.
i hope it helps you.


This is how the button looks when we are done.

// 
Sub to_tempArchive()
Set objFolder = GetFolder("2013 Archive \02 Archive")


Set ArchiveFolder = Application.GetNamespace("MAPI"). _
GetDefaultFolder(olFolderInbox).Parent.Folders("temp_Archive")



For Each Msg In ActiveExplorer.Selection
Msg.UnRead = False
Msg.Move objFolder

Next Msg
End Sub


Public Function GetFolder(strFolderPath As String) As MAPIFolder
  ' strFolderPath needs to be something like
  '   "Public Folders\All Public Folders\Company\Sales" or
  '   "Personal Folders\Inbox\My Folder"

  Dim objApp As Outlook.Application
  Dim objNS As Outlook.NameSpace
  Dim colFolders As Outlook.Folders
  Dim objFolder As Outlook.MAPIFolder
  Dim arrFolders() As String
  Dim I As Long
  On Error Resume Next

  strFolderPath = Replace(strFolderPath, "/", "\")
  arrFolders() = Split(strFolderPath, "\")
  Set objApp = Application
  Set objNS = objApp.GetNamespace("MAPI")
  Set objFolder = objNS.Folders.Item(arrFolders(0))
  If Not objFolder Is Nothing Then
    For I = 1 To UBound(arrFolders)
      Set colFolders = objFolder.Folders
      Set objFolder = Nothing
      Set objFolder = colFolders.Item(arrFolders(I))
      If objFolder Is Nothing Then
        Exit For
      End If
    Next
  End If

  Set GetFolder = objFolder
  Set colFolders = Nothing
  Set objNS = Nothing
  Set objApp = Nothing
End Function

spreadfirefox

what a Great way to spread the joy of firefox around. do Get a button for your site / blog and spread the word around.
http://www.spreadfirefox.com/

Resolve oracle error codes to meanings in Linux/Oracle

i watched over the shoulder of one of my office mate as she used this cool trick/feature in an attempt to troubleshoot an issue that i was having with my shell script. It had failed with a cryptic oracle error and i had idea what it was. so she came in and showed how to find what the oracle error message means from the code.

I sure saved me a a ton of time as normally i would have fired up my firefox and would have wasted another 20 mins of my time gawking over tons of ways to do the same.

Its pretty simple, just orr ora

Example:

$ oerr ora 0001
00001, 00000, “unique constraint (%s.%s) violated”
// *Cause: An UPDATE or INSERT statement attempted to insert a duplicate key.
// For Trusted Oracle configured in DBMS MAC mode, you may see
// this message if a duplicate entry exists at a different level.
// *Action: Either remove the unique restriction or do not insert the key.
$

i will sure dig further on this and see what other things can be learnt like this.

Convention Vs Rule

Literally
Convention is something that can be broken
Rule is something that cannot be broken

In IT ..,
Rule is something that can be broken,
Convention is something that cannot be broken


Does it sound
either amazing ( that means you already understood it, you can afford to skip reading the rest)
or confusing ( you must read to find out what it means )?

First the Litral meaning:
In real world ( non-computer world )

you can not break a rule, you will be either peanilised or punished for breaking a rule.
eg:  you cannot break a traffic rule

You can certainly break away from concention, and thats how most of the fashion industry works.
you can try a new hair style which is not one of the regular styles men/women of your status would have.

now in the computer World

    You can break a rule, your java compiler might yell a few warnings yet your code will work ( even if not the way u expected it to work)

but break a convention .., NO way.,
eg: the convention is that your mail server runs on port 25 .., as a rule & technically this server can run on any port that is vacent in the host system .., but that wonnt get you anywhere. as the whole world as a convention expects mail servers to work on port 25.

so .., you cannt  break a convention in the computer world..,
is it clear now..??

information provided by my friend : Lakshmi



DOS Batch Script to Track record count in database.

In my workday one of the daily duty is to check how many number of records are
in a particular table in the database everyday.
Today we wanted the frequency of checking to be changed to every 30 mins.
so i came up with this logger.

It has two Files.
1. A Batch Script - Tracker.bat
2. A SQL Script - qry.sql

Tracker.bat
REM *****************************************************
REM Script to Record & Track the number of records in a table
REM **********************************************************
REM Depends on qry.sql to find the DB time and the actual record count
REM Scheduled as a windows scheduled task
REM for every 1/2 an Hour / any frequency you prefer
REM ****************************************************
@echo off
sqlplus db-username/db-password@db-name> @qry.sql
REM Example scoot/tiger@hr @qry.sql
ECHO Log Copied on %DATE% %TIME% >>out.txt
type noticount.log >>out.txt
del noticount.log

Qry.sql

SPOOL noticount.log;
select to_char (sysdate,'DD/MM/YYYY HH:MM::SS') DB_Time , count(*) No_of_Records from <YOUR_TABLE_NAME>;
SPOOL OFF;
EXIT;

Once scheduled the script creates a log file called "out.txt" with the contents like.,

Log Copied on Fri 06/23/2006 12:12:19.59
DB_TIME NO_OF_RECORDS
-------------------- -------------------
23/06/2006 02:06::09 1

Log Copied on Fri 06/23/2006 12:12:37.15
DB_TIME NO_OF_RECORDS
-------------------- -------------------
23/06/2006 02:06::27 1

You can use this scripts to monitor the database for various details just by doing some simple modifications.
i am trying now to directly write it into a excel file.., will let you all know once i do that.,
till then i hope this would make somebody's life a bit easier


(\/) Sifar

Find all Open Ports

My friend Ram has called me atleast twice to find out a command to see all ports open in a windows based system.
Every time i have given him the solution only to forget it the next instant.
so for me to remember and all of you who want to know and remember..,

the command is : netstat

As per the documentation It

"Displays protocol statistics and current TCP/IP network connections.
try your hand a bit with combination of options .., you will find it handy in troubleshooting.

Yahoo Widgets

being the lover of mac machines that i am .,
I always wanted to have widgets in my windows machine.
Microsoft is belived to be working on it yet and the vista version will have them by default.

but till then yahoo has come out with this beautiful thing called yahoo widget

        Try http://widgets.yahoo.com..

i was amazed at the quality and started using it immediatly .,.
you too can try .., they really make life a lot simpler.

Javascript test in IE

I recived a mail form a colluge today,
He wanted me to paste the following line in the address bar of my internet explorer and click go.

viola..! There came a message.

well thats really good isn't it.
You can write small javascript function and may be test them in IE with out creating a page.
I tested in firefox too, it works.

So, I learnt this today.

"Java script can be executed in IE without a page"

i hope that for people who donn know this already this will be useful.

SAMPLE CODE:
javascript:function reverse() { var inp = " TSEB EHT SI RAFIS ……rebmemer n !! krow lufesu emos od oG "; var outp = ""; for (i = 0; i <= inp.length; i++) { outp = inp.charAt (i) + outp ; } alert(outp) ;}; reverse();

Speed up Adobe Acrobat Reader loading

 

 speed up  Adobe Acrobat Reader loads ?


Annoyed by frequently having to wait 10-20 seconds for the application to load when all you want to do was view a single page?

Here's how to do it:

Go to

C:\Program Files\Adobe\Acrobat 7.0(or whatever version)\Reader \

or where ever  you have installed it

Move all files from the plug_ins folder to the optional folder .(Cut and Paste). ----- cut and paste all the files and folders (do not just copy)
You're done.


Now Acrobat Reader is as fast as a notepad ......

Caution :

You will loose certain features of the reader.

but,most of these features u hardly use.

 

 

 

 



how to always open with a particular sheet in a excel file

This is a snippet of code that i wrote for for my ex-rommies nambi,gagan & Arun (nizam)
they had asked about opening excel file with a preset sheet being shown first always ..,
and hear is how it is done.

1. open ur excel file
2. press <Alt> + F11
3. u will be looking at an IDE now.,. ( something very similar to VB )
4. on the left side .., u will see a " project browser window " ( with Project - VBAproject as title )
5. double click on the "This Workbook" object..,
6. a codeing region opens up
7. Paste this code into that area

Private Sub Workbook_Open()
Worksheets(3).Activate
End Sub

8. Change the number (3) to the sheet number that u want to open every time the file is opened..,

HelloWorld.blog

This is Sifar here..,
this blog is to keep a timelined web post of my tech thoughts and works.