Skip to main content

Posts

Showing posts from October, 2012

Keep your windows machine Unlock while QTP Running.

Below are the Few ways to  Keep your windows machine Unlock: Way 1: Install the Caffeine 1.4 software on machine where u run the scripts.  =========================================================================== Way 2: Create a .vbs file with the below code and run the script using task scheduler Const DELAY_MINUTES = 10 Wscript.Sleep DELAY_MINUTES * 60000 Do    CreateObject(“Wscript.Shell”).SendKeys “+”    Wscript.Sleep DELAY_MINUTES * 60000 Loop ===========================================================================  Way 3: Create a .vbs file with the below code and run the script Const micVoid = 0 Const micByte = 26 Const micLong = 3 Const KEYEVENTF_KEYUP = &H2 Set Extern = CreateObject("Mercury.ExternObj") extern.Declare micVoid, "keybd_event", "user32", "keybd_event", micByte, micbyte, miclong, micLong Extern.Declare micVoid, "Sleep", "kernel32", "Sleep", micLon

Read Outlook mail attachment and Body using Vb Script or QTP

Set olApp = CreateObject("Outlook.Application") Set olns = olApp.GetNameSpace("MAPI") Set ObjFolder = olns.GetDefaultFolder(6) j = 0 For each item1 in ObjFolder.Items        iattachCnt = item1.Attachments.Count     Print "Attachments Count: " & iattachCnt     For i = 1 to iattachCnt         Print "FileName :    " & item1.Attachments(i).FileName         Print "Display Name:   " & item1.Attachments(i).DisplayName         Print "Size: " & item1.Attachments(i).Size     Next     Print " Body : " & item1.body     Print "--------------------------------------Mail Num - " & j & " -----------------------------------------------"     j = j+1    Next