<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>CodeKeep VBScript Feed</title>
    <description>The latest and greatest VBScript code snippets publicly available</description>
    <link>http://www.codekeep.net/feeds.aspx</link>
    <lastBuildDate>Thu, 19 Apr 2012 19:49:37 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>RSS.NET: http://www.rssdotnet.com/</generator>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/CodeKeepVBScript" /><feedburner:info uri="codekeepvbscript" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
      <title>WhoIsLoggedIn.vbs</title>
      <description>Description: This script will return user detail from active directory for a given IP Address or Host Name.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/a4c58b26-3467-482a-8647-576518602de4.aspx'&gt;http://www.codekeep.net/snippets/a4c58b26-3467-482a-8647-576518602de4.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;On Error Resume Next

WScript.StdOut.Write(&amp;quot;IP Address/Computer Name&amp;gt; &amp;quot;)
WScript.StdIn.Read(0)
strComputer = WScript.StdIn.ReadLine()

If IsHostAlive(strComputer) = False Then Wscript.quit

For Each strComputer In arrComputers
	Set objWMIService = GetObject(&amp;quot;winmgmts:{impersonationLevel=impersonate}!\\&amp;quot; &amp;amp; strComputer &amp;amp; &amp;quot;\root\cimv2&amp;quot;)
	Set colItems = objWMIService.ExecQuery(&amp;quot;Select * from Win32_ComputerSystem&amp;quot;,,48)
  	For Each objItem in colItems
			If IsNull(objItem.UserName) = False Then
    		Wscript.Echo &amp;quot;Computer Name: &amp;quot; &amp;amp; objItem.DNSHostName
    		Wscript.Echo &amp;quot;UserName: &amp;quot; &amp;amp; objItem.UserName
    		GetUserName(objItem.UserName)
    	Else
    		Wscript.Echo &amp;quot;Computer Name: &amp;quot; &amp;amp; objItem.DNSHostName
    		Wscript.Echo &amp;quot;UserName: Null&amp;quot;
    	End If
   	Next
Next

'*******************************************************************************

Function GetUserName(LoginID)
	' Constants for the NameTranslate object.
	Const ADS_NAME_INITTYPE_GC = 3
	Const ADS_NAME_TYPE_NT4 = 3
	Const ADS_NAME_TYPE_1779 = 1

	' Determine DNS name of domain from RootDSE.
	Set objRootDSE = GetObject(&amp;quot;LDAP://RootDSE&amp;quot;)
	strDNSDomain = objRootDSE.Get(&amp;quot;defaultNamingContext&amp;quot;)

	' Use the NameTranslate object to find the NetBIOS domain name from the
	' DNS domain name.
	Set objTrans = CreateObject(&amp;quot;NameTranslate&amp;quot;)
	objTrans.Init ADS_NAME_INITTYPE_GC, &amp;quot;&amp;quot;
	objTrans.Set ADS_NAME_TYPE_1779, strDNSDomain
	strNetBIOSDomain = objTrans.Get(ADS_NAME_TYPE_NT4)
	' Remove trailing backslash.
	strNetBIOSDomain = Left(strNetBIOSDomain, Len(strNetBIOSDomain) - 1)

	strNTName = Trim(LoginID)

	' Use the Set method to specify the NT format of the object name.
	' Trap error if user does not exist.
	On Error Resume Next

	objTrans.Set ADS_NAME_TYPE_NT4, strNTName

	If (Err.Number = 0) Then
		On Error GoTo 0
		' Use the Get method to retrieve the RPC 1779 Distinguished Name.
		strUserDN = objTrans.Get(ADS_NAME_TYPE_1779)

		' Bind to the user object (if desired).
		Set objUser = GetObject(&amp;quot;LDAP://&amp;quot; &amp;amp; strUserDN)
		' Do whatever you want...
		wscript.echo &amp;quot;Name: &amp;quot; &amp;amp; objUser.GivenName &amp;amp; &amp;quot; &amp;quot; &amp;amp; objUser.sn
		wscript.echo &amp;quot;Phone: &amp;quot; &amp;amp; objUser.physicalDeliveryOfficeName
		wscript.echo &amp;quot;Office: &amp;quot; &amp;amp; objUser.telephonenumber
		wscript.echo &amp;quot;Mobile: &amp;quot; &amp;amp; objUser.mobile
	Else
		On Error GoTo 0
		' Alert user about bad user name.
		Wscript.Echo &amp;quot;User &amp;quot; &amp;amp; strNTName &amp;amp; &amp;quot; does not exist&amp;quot;
	End If
End Function


Function IsHostAlive(strComputer)
        IsHostAlive = False                                ' normally we will return false, unless ping is successful

        Set objWMIService = GetObject(&amp;quot;winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2&amp;quot;)
        Set colItems = objWMIService.ExecQuery(&amp;quot;SELECT * FROM Win32_PingStatus WHERE Address = '&amp;quot; + strComputer + &amp;quot;'&amp;quot;)

        For Each oRow In colItems
          	Select Case oRow.StatusCode
          		Case 0
          			IsHostAlive = True
          			wscript.echo strComputer &amp;amp; &amp;quot; is alive...&amp;quot;
				      Case 11001 wscript.echo &amp;quot;Buffer Too Small&amp;quot;
      				Case 11002 wscript.echo &amp;quot;Destination Net Unreachable&amp;quot;
      				Case 11003 wscript.echo &amp;quot;Destination Host Unreachable&amp;quot;
      				Case 11004 wscript.echo &amp;quot;Destination Protocol Unreachable&amp;quot;
      				Case 11005 wscript.echo &amp;quot;Destination Port Unreachable&amp;quot;
      				Case 11006 wscript.echo &amp;quot;No Resources&amp;quot;
							Case 11007 wscript.echo &amp;quot;Bad Option&amp;quot;
      				Case 11008 wscript.echo &amp;quot;Hardware Error&amp;quot;
      				Case 11009 wscript.echo &amp;quot;Packet Too Big&amp;quot;
      				Case 11010 wscript.echo &amp;quot;Request Timed Out&amp;quot;
      				Case 11011 wscript.echo &amp;quot;Bad Request&amp;quot;
      				Case 11012 wscript.echo &amp;quot;Bad Route&amp;quot;
      				Case 11013 wscript.echo &amp;quot;TimeToLive Expired Transit&amp;quot;
      				Case 11014 wscript.echo &amp;quot;TimeToLive Expired Reassembly&amp;quot;
      				Case 11015 wscript.echo &amp;quot;Parameter Problem&amp;quot;
      				Case 11016 wscript.echo &amp;quot;Source Quench&amp;quot;
      				Case 11017 wscript.echo &amp;quot;Option Too Big&amp;quot;
      				Case 11018 wscript.echo &amp;quot;Bad Destination&amp;quot;
      				Case 11032 wscript.echo &amp;quot;Negotiating IPSEC&amp;quot;
      				Case 11050 wscript.echo &amp;quot;General Failure&amp;quot;
      				Case Else wscript.echo &amp;quot;Status code &amp;quot; &amp;amp; objPing.StatusCode &amp;amp; &amp;quot; - Unable to determine cause of failure.&amp;quot;
    		End Select
        Next
End Function&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/nvXenbdkR6s" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/nvXenbdkR6s/a4c58b26-3467-482a-8647-576518602de4.aspx</link>
      <pubDate>Thu, 19 Apr 2012 19:49:37 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/a4c58b26-3467-482a-8647-576518602de4.aspx</feedburner:origLink></item>
    <item>
      <title>FreeDiskSpace Function</title>
      <description>Description: http://www.alanphipps.com/VBScript-DiskFile.html#FreeSpace

Adapted from URL above. This function can easily be adapted to output the integer value of available drive space in kilo, mega or gigabytes.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/e7a1e24e-6142-4cb5-a9b2-c6c1b6c43576.aspx'&gt;http://www.codekeep.net/snippets/e7a1e24e-6142-4cb5-a9b2-c6c1b6c43576.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Function FreeDiskSpace(DriveLetter)
   ' Returns the number of free Megabytes on a given drive
   ' http://www.alanphipps.com/VBScript-DiskFile.html
   ' Instantiate the VBScript FileSystemObject
   Set FsoObject = WScript.CreateObject(&amp;quot;Scripting.FileSystemObject&amp;quot;)

   ' Use the FilesystemObject Object's GetDrive Method
   Set DiskDrive = FsoObject.GetDrive(FsoObject.GetDriveName(DriveLetter &amp;amp; &amp;quot;:&amp;quot;))

   ' Main Processing Section

   ' Use the FileSystemObjects FreeSpace Property to Determine the Amount of FreeSpace in MB
   ' on the C: Drive

   AvailSpacebytes = DiskDrive.FreeSpace
   AvailSpaceKB = DiskDrive.FreeSpace / 1024
   AvailSpaceMB = (DiskDrive.FreeSpace / 1024) / 1024
   AvailSpaceGB = ((DiskDrive.FreeSpace / 1024) / 1024) / 1024

   ' Use VBScripts FormatNumber Function to format the results as a Whole Number
   AvailSpacebytes = FormatNumber(AvailSpacebytes, 0)
   AvailSpaceKB = FormatNumber(AvailSpaceKB, 0)
   AvailSpaceMB = FormatNumber(AvailSpaceMB, 0)
   AvailSpaceGB = FormatNumber(AvailSpaceGB, 0)

   ' Display the Amount of Free Space on the C: Drive
   WScript.Echo &amp;quot;There is Currently: &amp;quot; &amp;amp; AvailSpacebytes &amp;amp; &amp;quot; bytes available on the C: Drive&amp;quot; &amp;amp; vbCrLf &amp;amp; _
   &amp;quot;There is Currently: &amp;quot; &amp;amp; AvailSpaceKB &amp;amp; &amp;quot;KB available on the C: Drive&amp;quot; &amp;amp; vbCrLf &amp;amp; _
   &amp;quot;There is Currently: &amp;quot; &amp;amp; AvailSpaceMB &amp;amp; &amp;quot;MB available on the C: Drive&amp;quot; &amp;amp; vbCrLf &amp;amp; _
   &amp;quot;There is Currently: &amp;quot; &amp;amp; AvailSpaceGB &amp;amp; &amp;quot;GB available on the C: Drive&amp;quot; &amp;amp; vbCrLf

   FreeDiskSpace = AvailSpaceMB
End Function&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/dHVwRSr_ydY" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/dHVwRSr_ydY/e7a1e24e-6142-4cb5-a9b2-c6c1b6c43576.aspx</link>
      <pubDate>Wed, 18 Apr 2012 20:18:40 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/e7a1e24e-6142-4cb5-a9b2-c6c1b6c43576.aspx</feedburner:origLink></item>
    <item>
      <title>VBA: Export Charts in Excel 2007</title>
      <description>Description: to export all the charts in active sheet in Excel&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/316b54c0-11cd-49fb-9193-6c191d33aea2.aspx'&gt;http://www.codekeep.net/snippets/316b54c0-11cd-49fb-9193-6c191d33aea2.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Sub ExportCharts()
   
    Dim objCht As ChartObject
    Dim strPath As String
   
    strPath = &amp;quot;C:\@Projects\_R9Insite\pages\fas\images\chart\&amp;quot;
   
    For Each objCht In Sheets(&amp;quot;Sheet1&amp;quot;).ChartObjects
        objCht.Chart.Export strPath &amp;amp; objCht.Name &amp;amp; &amp;quot;.gif&amp;quot;, filtername:=&amp;quot;gif&amp;quot;
    Next

End Sub&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/WftxL3BC88w" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/WftxL3BC88w/316b54c0-11cd-49fb-9193-6c191d33aea2.aspx</link>
      <pubDate>Fri, 10 Feb 2012 15:55:36 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/316b54c0-11cd-49fb-9193-6c191d33aea2.aspx</feedburner:origLink></item>
    <item>
      <title>QTP DOM</title>
      <description>Description: Access sibling/parent in QTP&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/60ad6f69-4c4e-409e-a992-7660857b039c.aspx'&gt;http://www.codekeep.net/snippets/60ad6f69-4c4e-409e-a992-7660857b039c.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;rc = Browser(&amp;quot;name:=.*WebSeries.*&amp;quot;).Page(&amp;quot;title:=.*&amp;quot;).WebButton(&amp;quot;type:=button&amp;quot;,&amp;quot;index:=7&amp;quot;).Object.PreviousSibling.innertext
MsgBox(rc)

Set oPwBox1 = Browser(&amp;quot;micclass:=Browser&amp;quot;).Page(&amp;quot;micclass:=Page&amp;quot;).WebEdit(&amp;quot;html tag:=INPUT&amp;quot;, &amp;quot;name:=char1&amp;quot;)
oPwBox1.Object.parentNode.previousSibling.innertext
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/cqrX-5EuxyU" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/cqrX-5EuxyU/60ad6f69-4c4e-409e-a992-7660857b039c.aspx</link>
      <pubDate>Fri, 21 Oct 2011 01:13:11 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/60ad6f69-4c4e-409e-a992-7660857b039c.aspx</feedburner:origLink></item>
    <item>
      <title>Setting the style of the DataGridView control</title>
      <description>Description: Setting the style of the DataGridView control&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/4840d10e-4791-4434-85f2-7896147d902d.aspx'&gt;http://www.codekeep.net/snippets/4840d10e-4791-4434-85f2-7896147d902d.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;' Setting the style of the DataGridView control
        DataGridView1.ColumnHeadersDefaultCellStyle.Font = New Font(&amp;quot;Tahoma&amp;quot;, 8, FontStyle.Bold, GraphicsUnit.Point)
        DataGridView1.ColumnHeadersDefaultCellStyle.BackColor = SystemColors.ControlDark
        DataGridView1.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.[Single]
        DataGridView1.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
        DataGridView1.DefaultCellStyle.Font = New Font(&amp;quot;Tahoma&amp;quot;, 8, FontStyle.Regular, GraphicsUnit.Point)
        DataGridView1.DefaultCellStyle.BackColor = Color.Empty
        DataGridView1.AlternatingRowsDefaultCellStyle.BackColor = SystemColors.ControlLight
        DataGridView1.CellBorderStyle = DataGridViewCellBorderStyle.[Single]
        DataGridView1.GridColor = SystemColors.ControlDarkDark&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/BIRA0LrV6gU" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/BIRA0LrV6gU/4840d10e-4791-4434-85f2-7896147d902d.aspx</link>
      <pubDate>Tue, 27 Sep 2011 06:27:36 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/4840d10e-4791-4434-85f2-7896147d902d.aspx</feedburner:origLink></item>
    <item>
      <title>Macro for toggle comment block in VS</title>
      <description>Description: This will comment/uncomment out single lines or blocks. Single lines are commented 
with the same indention level. Blocks are commented at the beginning of the line.
Assign this to a key (e.g. ctrl-/) and it will toggle the current line/bloc&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/694ef029-4d64-4b7d-b42d-866cfd7a0c4c.aspx'&gt;http://www.codekeep.net/snippets/694ef029-4d64-4b7d-b42d-866cfd7a0c4c.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
'Imports EnvDTE90a
'Imports EnvDTE100
Imports System.Diagnostics

Public Module ToggleComment
    'Constant              Value
    '---------------------------
    'dsMove                  0
    'dsExtend                1
    'dsFirstColumn           0
    'dsFirstText             1
    'dsLowercase             1
    'dsUppercase             2
    'dsCapitalize            3
    'dsHorizontal            0
    'dsVertical              1
    'dsLastLine              -1
    'dsDevStudio             0
    'dsVC2                   1
    'dsBrief                 2
    'dsEpsilon               3
    'dsCustom                4
    'dsMatchWord             2
    'dsMatchCase             4
    'dsMatchNoRegExp         0
    'dsMatchRegExp           8
    'dsMatchRegExpB          16
    'dsMatchRegExpE          32
    'dsMatchRegExpCur        64
    'dsMatchForward          0
    'dsMatchBackward         128
    'dsMatchFromStart        256
    'dsWindowStateMaximized  1
    'dsWindowStateMinimized  2
    'dsWindowStateNormal     3
    'dsMinimize              1
    'dsTileHorizontal        2
    'dsTileVertical          3
    'dsCascade               4
    'dsGlyph                 1
    'dsText                  2
    'dsSaveChangesYes        1
    'dsSaveChangesNo         2
    'dsSaveChangesPrompt     3
    'dsSaveSucceeded         1
    'dsSaveCanceled          2
    'dsTextDocument          &amp;quot;Text&amp;quot;
    'dsVBSMacro              &amp;quot;VBS Macro&amp;quot;
    'dsJava                  &amp;quot;Java&amp;quot;
    'dsCPP                   &amp;quot;C/C++&amp;quot;
    'dsIDL                   &amp;quot;ODL/IDL&amp;quot;
    'dsHTML_IE3              &amp;quot;HTML - IE 3.0&amp;quot;
    'dsHTML_RFC1866          &amp;quot;HTML 2.0 (RFC 1866)&amp;quot;
    'dsFortran_Fixed         &amp;quot;Fortran Fixed&amp;quot;
    'dsFortran_Free          &amp;quot;Fortran Free&amp;quot;

    '----------------------------------------------------------------------------------
    ' This routine has many uses if you are trying to determine the type of source file.
    ' This has been modified from the one included with DevStudio
    ' Return value:  0 Unknown file type
    '               1 C-related file, this includes .c, .cpp, .cxx, .h, .hpp, .hxx
    '               2 Java-related file, this includes .jav, .java
    '               3 ODL-style file, .odl, .idl
    '               4 VBS-style file, .dsm
    '               5 VBS-style file, .asp
    '               6 HTML-style file, this includes .html, and .htm
    '               7 Resource file, .rc, .rc2
    '               8 Def-style file, .def
    ' USE: Pass this function the document that you wish to get information for.
    '----------------------------------------------------------------------------------
    Function FileType(ByVal doc)
        Dim ext = doc.Name
        FileType = 0
        Dim pos = InStr(ext, &amp;quot;.&amp;quot;)
        If pos &amp;gt; 0 Then
            Do While pos &amp;lt;&amp;gt; 1
                ext = Mid(ext, pos, Len(ext) - pos + 1)
                pos = InStr(ext, &amp;quot;.&amp;quot;)
            Loop
            ext = LCase(ext)
        End If

        If ext = &amp;quot;.rc&amp;quot; Or ext = &amp;quot;.rc2&amp;quot; Then
            FileType = 7
        ElseIf doc.Language = EnvDTE.Constants.dsCPP Then
            FileType = 1
        ElseIf doc.Language = EnvDTE.Constants.dsJava Then
            FileType = 2
        ElseIf doc.Language = EnvDTE.Constants.dsIDL Then
            FileType = 3
        ElseIf ext = &amp;quot;.js&amp;quot; Then
            FileType = 4
        ElseIf doc.Language = EnvDTE.Constants.dsVBSMacro Then
            FileType = 5
        ElseIf ext = &amp;quot;.asp&amp;quot; Then
            FileType = 6
        ElseIf doc.Language = EnvDTE.Constants.dsHTML_IE3 Or doc.Language = EnvDTE.Constants.dsHTML_RFC1866 Then
            FileType = 7
        ElseIf ext = &amp;quot;.def&amp;quot; Then
            FileType = 8
        Else
            FileType = 0
        End If

        'MsgBox &amp;quot;Ext:&amp;quot; + vbTab + ext + vbLf + &amp;quot;Lang:&amp;quot; + vbTab + doc.Language + vbLf + &amp;quot;Type:&amp;quot; + vbTab + CStr(FileType)
    End Function

    '------------------------------------------------------------------------------
    'FILE DESCRIPTION: These are useful macros by Adam Solesby [adam@solesby.com]
    '------------------------------------------------------------------------------


    '----------------------------------------------------------------------------------
    ' This will comment/uncomment out single lines or blocks. Single lines are commented 
    ' with the same indention level. Blocks are commented at the beginning of the line.
    ' Assign this to a key (e.g. ctrl-/) and it will toggle the current line/block of code.
    ' This will handle both &amp;quot;//&amp;quot; and &amp;quot;'&amp;quot; style comments
    '
    ' Author: Adam Solesby -- http://solesby.com, Sowrov -- http://sowrov.com
    '----------------------------------------------------------------------------------

    Sub Switch()
        Dim dsFirstColumn = 0
        Dim dsFirstText = 1
        'DESCRIPTION: Comments out a selected block of text. (ctrl-/)
        If DTE.ActiveDocument.Type &amp;lt;&amp;gt; &amp;quot;Text&amp;quot; Then
            MsgBox(&amp;quot;This macro can only be run when a text editor window is active.&amp;quot;)
        Else
            Dim TypeOfFile = FileType(DTE.ActiveDocument)
            Dim CommentType, CommentWidth, StartLine, EndLine, Temp, s, n
            '	MsgBox &amp;quot;Type: &amp;quot; + CStr(TypeOfFile)
            If TypeOfFile &amp;gt; 0 And TypeOfFile &amp;lt; 7 Then
                If TypeOfFile &amp;gt; 4 Then
                    CommentType = &amp;quot;'&amp;quot;   ' VBShit
                    CommentWidth = 1
                Else
                    CommentType = &amp;quot;//&amp;quot;  ' C++ and java style comments

                    CommentWidth = 2
                End If
                StartLine = ActiveDocument.Selection.TopLine
                EndLine = ActiveDocument.Selection.BottomLine
                If EndLine &amp;lt; StartLine Then
                    Temp = StartLine
                    StartLine = EndLine
                    EndLine = Temp
                End If
                ' single line with words selected
                If EndLine = StartLine And Len(ActiveDocument.Selection.Text) &amp;gt; 0 Then
                    s = ActiveDocument.Selection.Text
                    n = Len(ActiveDocument.Selection.Text)
                    ' convert &amp;quot;/*sample text*/&amp;quot; =&amp;gt; &amp;quot;sample text&amp;quot; (&amp;quot;/*sample text*/&amp;quot; selected)
                    If Left(s, 2) = &amp;quot;/*&amp;quot; And Right(s, 2) = &amp;quot;*/&amp;quot; Then
                        ActiveDocument.Selection.Text = Mid(s, 3, n - 4)
                    Else
                        ActiveDocument.Selection.CharLeft()
                        ActiveDocument.Selection.CharLeft(EnvDTE.DsMovementOptions.dsMove, 2)
                        ActiveDocument.Selection.CharRight(EnvDTE.DsMovementOptions.dsExtend, n + 4)
                        Dim s2 = ActiveDocument.Selection.Text
                        ' convert &amp;quot;/*sample text*/&amp;quot; =&amp;gt; &amp;quot;sample text&amp;quot; (&amp;quot;sample text&amp;quot; selected)
                        If Left(s2, 2) = &amp;quot;/*&amp;quot; And Right(s2, 2) = &amp;quot;*/&amp;quot; Then
                            ActiveDocument.Selection.Text = s

                            ' convert &amp;quot;sample text&amp;quot; =&amp;gt; &amp;quot;/*sample text*/&amp;quot; (&amp;quot;sample text&amp;quot; selected)
                        Else
                            ActiveDocument.Selection.CharLeft()
                            ActiveDocument.Selection.CharRight(EnvDTE.DsMovementOptions.dsMove, 2)
                            ActiveDocument.Selection.CharRight(EnvDTE.DsMovementOptions.dsExtend, n)
                            ActiveDocument.Selection.Text = &amp;quot;/*&amp;quot; &amp;amp; s &amp;amp; &amp;quot;*/&amp;quot;
                        End If

                    End If

                    ' Single line -- comment at start of text
                    '   have to check for comments at start of line and start of text
                ElseIf EndLine = StartLine Then
                    ActiveDocument.Selection.StartOfLine(dsFirstText)
                    ActiveDocument.Selection.CharRight(EnvDTE.DsMovementOptions.dsExtend, CommentWidth)
                    If ActiveDocument.Selection.Text = CommentType Then
                        ActiveDocument.Selection.Delete()
                    Else
                        'ActiveDocument.Selection.StartOfLine(dsFirstText)
                        'ActiveDocument.Selection.CharRight(EnvDTE.DsMovementOptions.dsExtend, CommentWidth)
                        'If ActiveDocument.Selection.Text = CommentType Then

                        '    ActiveDocument.Selection.CharLeft()
                        '    ActiveDocument.Selection.EndOfLine(EnvDTE.DsMovementOptions.dsExtend)
                        '    s = ActiveDocument.Selection.Text
                        '    s = LTrim(Mid(s, 3))

                        '    Do While Left(s, 1) = vbTab
                        '        s = LTrim(Mid(s, 2))
                        '    Loop

                        '    ActiveDocument.Selection.Text = s

                        'Else
                        ActiveDocument.Selection.StartOfLine(dsFirstText)
                        ActiveDocument.Selection.Text = CommentType + ActiveDocument.Selection.Text
                        'End If
                    End If
                    ActiveDocument.Selection.StartOfLine(dsFirstText)

                    ' Multi-line -- comment at start of line
                Else
                    Dim CommentLoc = 1 'dsFirstText
                    Dim bAddComment
                    '' check whether commenting on or off based on the _last_ line of selection
                    'ActiveDocument.Selection.GoToLine(EndLine)
                    'ActiveDocument.Selection.StartOfLine(CommentLoc)
                    'ActiveDocument.Selection.CharRight(EnvDTE.DsMovementOptions.dsExtend, CommentWidth)
                    'If ActiveDocument.Selection.Text = CommentType Then
                    '    bAddComment = False
                    'Else
                    '    bAddComment = True
                    'End If

                    ' now do it to each line
                    For i = StartLine To EndLine
                        ActiveDocument.Selection.GoToLine(i)
                        ActiveDocument.Selection.StartOfLine(CommentLoc)
                        ActiveDocument.Selection.CharRight(EnvDTE.DsMovementOptions.dsExtend, CommentWidth)
                        If ActiveDocument.Selection.Text = CommentType Then
                            'ActiveDocument.Selection.CharRight(EnvDTE.DsMovementOptions.dsExtend, CommentWidth)
                            ActiveDocument.Selection.Delete()
                        Else
                            ActiveDocument.Selection.Text = CommentType + ActiveDocument.Selection.Text
                        End If
                    Next

                    ' work with strings so that we can do a single undo in editor
                    'ActiveDocument.Selection.MoveTo(StartLine, 1)
                    'DTE.ActiveDocument.Selection.LineDown(True, EndLine - StartLine + 1)
                    's = ActiveDocument.Selection.Text

                    'If bAddComment Then
                    '    s = CommentType &amp;amp; Replace(s, vbNewLine, vbNewLine &amp;amp; CommentType)
                    'Else
                    '    s = Replace(s, vbNewLine &amp;amp; CommentType, vbNewLine)
                    '    s = Mid(s, Len(CommentType) + 1)
                    'End If
                    ''MsgBox(s)
                    'ActiveDocument.Selection.Text = s

                End If
            Else
                MsgBox(&amp;quot;Unable to comment out the highlighted text&amp;quot; + vbLf + _
                 &amp;quot;because the file type was unrecognized.&amp;quot; + vbLf + _
                 &amp;quot;If the file has not yet been saved, &amp;quot; + vbLf + _
                 &amp;quot;please save it and try again.&amp;quot;)
            End If
        End If
    End Sub

End Module

&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/JxB4PfrOR3k" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/JxB4PfrOR3k/694ef029-4d64-4b7d-b42d-866cfd7a0c4c.aspx</link>
      <pubDate>Wed, 23 Feb 2011 05:12:24 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/694ef029-4d64-4b7d-b42d-866cfd7a0c4c.aspx</feedburner:origLink></item>
    <item>
      <title>GUID Macro</title>
      <description>Description: GUID Macro&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/20ca2dca-beca-43c2-b358-3df53705a249.aspx'&gt;http://www.codekeep.net/snippets/20ca2dca-beca-43c2-b358-3df53705a249.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Sub InsertGuid()
  Dim objTextSelection As TextSelection
  objTextSelection = CType(DTE.ActiveDocument.Selection(), EnvDTE.TextSelection)
  objTextSelection.Text = System.Guid.NewGuid.ToString(&amp;quot;D&amp;quot;).ToUpperInvariant
End Su&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/a4acVzQbCDw" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/a4acVzQbCDw/20ca2dca-beca-43c2-b358-3df53705a249.aspx</link>
      <pubDate>Fri, 20 Aug 2010 08:39:02 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/20ca2dca-beca-43c2-b358-3df53705a249.aspx</feedburner:origLink></item>
    <item>
      <title>VerifyCScript</title>
      <description>Description: This subroutine will make sure the script is being run with the Cscript and not Wscript engine.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/b2c7be41-b040-4ac5-87a5-2e3ac214e23f.aspx'&gt;http://www.codekeep.net/snippets/b2c7be41-b040-4ac5-87a5-2e3ac214e23f.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Sub VerifyCscript 
    'When called, confirms script is being run with Cscript engine.
    'If not, it calls the original script with the Cscript egine 
    'including all passed parameters and end current wscript instance.

    Dim objShell, Return, strCmd, strArg
    if lcase(right(wscript.fullname,11))=&amp;quot;wscript.exe&amp;quot; then
        set objShell = CreateObject(&amp;quot;wscript.shell&amp;quot;)
        strCmd = &amp;quot;cscript.exe &amp;quot; &amp;amp; chr(34) &amp;amp; WScript.ScriptFullName &amp;amp; chr(34)
        if objArgs.Count &amp;gt; 0 then
            for each strArg in objArgs
                strCmd = strCmd &amp;amp; &amp;quot; &amp;quot; &amp;amp; strArg
            next
        end if
        Return = objShell.Run (strCmd,1,false)
        set objShell = nothing
        wscript.quit
    end if
end sub 'End of VerifyCScript
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/UFGA0-rYg7E" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/UFGA0-rYg7E/b2c7be41-b040-4ac5-87a5-2e3ac214e23f.aspx</link>
      <pubDate>Tue, 22 Sep 2009 15:04:13 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/b2c7be41-b040-4ac5-87a5-2e3ac214e23f.aspx</feedburner:origLink></item>
    <item>
      <title>VBscript - List All files in a folder</title>
      <description>Description: Vbscript - List all files in a folder.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/bc9ec2b5-f0ea-4075-8419-81b19e9157b5.aspx'&gt;http://www.codekeep.net/snippets/bc9ec2b5-f0ea-4075-8419-81b19e9157b5.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;On Error Resume Next  
Dim fso, folder, files, NewsFile,sFolder, objTextFile
Const ForReading = 1

Set fso = CreateObject(&amp;quot;Scripting.FileSystemObject&amp;quot;)
Set objOutputFile = fso.CreateTextFile(&amp;quot;AllFileNames.txt&amp;quot;)
currentPath  = Replace(Wscript.ScriptFullName, &amp;quot;\&amp;quot; &amp;amp; Wscript.ScriptName, &amp;quot;&amp;quot;)

sFolder = Wscript.Arguments.Item(0)  
	If sFolder = &amp;quot;&amp;quot; Then      
		sFolder =  currentPath 
	End If

Set files = fso.GetFolder(sFolder).Files
Echo &amp;quot;Chirag&amp;quot;
For each file In files    
	if lcase(objFSO.getExtensionName(file.name))=&amp;quot;mp3&amp;quot; Then
		objOutputFile.WriteLine file.name
	End if
Next  
objOutputFile.Close
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/O_iJ-zwmy6w" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/O_iJ-zwmy6w/bc9ec2b5-f0ea-4075-8419-81b19e9157b5.aspx</link>
      <pubDate>Mon, 11 May 2009 00:59:40 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/bc9ec2b5-f0ea-4075-8419-81b19e9157b5.aspx</feedburner:origLink></item>
    <item>
      <title>List and combine all text files in a folder</title>
      <description>Description: VBScript code to combine all text ( sql ) files in one file&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/9adfec8a-3167-4065-8762-2dd4c031ade4.aspx'&gt;http://www.codekeep.net/snippets/9adfec8a-3167-4065-8762-2dd4c031ade4.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;On Error Resume Next  
Dim fso, folder, files, NewsFile,sFolder, objTextFile
Const ForReading = 1

Set fso = CreateObject(&amp;quot;Scripting.FileSystemObject&amp;quot;)
Set objOutputFile = fso.CreateTextFile(&amp;quot;EMDAllStoredProcedures.sql&amp;quot;)
currentPath  = Replace(Wscript.ScriptFullName, &amp;quot;\&amp;quot; &amp;amp; Wscript.ScriptName, &amp;quot;&amp;quot;)

sFolder = Wscript.Arguments.Item(0)  
	If sFolder = &amp;quot;&amp;quot; Then      
		sFolder =  currentPath &amp;amp; &amp;quot;\Stored Procedures&amp;quot;
		'Wscript.Echo sFolder
		'Wscript.Quit  
	End If

Set files = fso.GetFolder(sFolder).Files
Echo file.Count
For each folderIdx In files    
	if lcase(objFSO.getExtensionName(file.path))=&amp;quot;txt&amp;quot; then
		Set objTextFile = fso.OpenTextFile(folderIdx.path, ForReading) 
		strText = objTextFile.ReadAll
		objTextFile.Close
		objOutputFile.WriteLine strText
	End if
Next  
objOutputFile.Close
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/hcM72e6Y5F4" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/hcM72e6Y5F4/9adfec8a-3167-4065-8762-2dd4c031ade4.aspx</link>
      <pubDate>Thu, 07 May 2009 19:17:12 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/9adfec8a-3167-4065-8762-2dd4c031ade4.aspx</feedburner:origLink></item>
    <item>
      <title>Escapes invalid text for XML</title>
      <description>Description: Removes invalid xml characters&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/bf9456f1-676f-442a-907a-b985cbceba80.aspx'&gt;http://www.codekeep.net/snippets/bf9456f1-676f-442a-907a-b985cbceba80.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Function Format4XML(str)
  str = replace(str, &amp;quot;&amp;amp;&amp;quot;, &amp;quot;&amp;amp;amp;&amp;quot;)
  str = replace(str, &amp;quot;\&amp;quot;, &amp;quot;&amp;amp;quot;&amp;quot;)
  str = replace(str, &amp;quot;'&amp;quot;, &amp;quot;&amp;amp;apos;&amp;quot;)
  str = replace(str, &amp;quot;&amp;lt;&amp;quot;, &amp;quot;&amp;amp;lt;&amp;quot;)
  str = replace(str, &amp;quot;&amp;gt;&amp;quot;, &amp;quot;&amp;amp;gt;&amp;quot;)
  Format4XML = str
end function&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/X-rdwK0oVko" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/X-rdwK0oVko/bf9456f1-676f-442a-907a-b985cbceba80.aspx</link>
      <pubDate>Fri, 20 Feb 2009 17:20:32 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/bf9456f1-676f-442a-907a-b985cbceba80.aspx</feedburner:origLink></item>
    <item>
      <title>Eventhandler für Controls im MS Datagrid verdrahten</title>
      <description>Description: Um auf den Controls in einem MS Datagrid Events zu verdrahten muss man sich durch den Visualtree arbeiten&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/d3b46a82-0fb9-4674-a3bb-e0e730bc70ee.aspx'&gt;http://www.codekeep.net/snippets/d3b46a82-0fb9-4674-a3bb-e0e730bc70ee.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;     Private Function AddCheckBoxHandlers() As Boolean

         Try
            Dim oRowsPresenter As DataGridRowsPresenter = Helpers.GetRowsPresenter(dgData)
            If Not oRowsPresenter Is Nothing Then
               For Each oRow In oRowsPresenter.Children
                  Dim oDataGridRow = TryCast(oRow, DataGridRow)
                  If oDataGridRow Is Nothing Then Continue For

                  Dim oRowBorder = TryCast(VisualTreeHelper.GetChild(oDataGridRow, 0), Border)
                  If oRowBorder Is Nothing Then Continue For

                  Dim oScrollingGrid = TryCast(oRowBorder.Child, SelectiveScrollingGrid)
                  If oScrollingGrid Is Nothing Then Continue For

                  Dim oCellsPresenter = TryCast(oScrollingGrid.Children(0), DataGridCellsPresenter)
                  If oCellsPresenter Is Nothing Then Continue For

                  Dim oCellsItemsPresenter = TryCast(VisualTreeHelper.GetChild(oCellsPresenter, 0), ItemsPresenter)
                  If oCellsItemsPresenter Is Nothing Then Continue For

                  Dim oCellsPanel = TryCast(VisualTreeHelper.GetChild(oCellsItemsPresenter, 0), DataGridCellsPanel)
                  If oCellsPanel Is Nothing Then Continue For

                  For Each oChild In oCellsPanel.Children
                     Dim oCell = TryCast(oChild, DataGridCell)
                     If oCell Is Nothing Then Continue For

                     Dim oCheckBoxColumn = TryCast(oCell.Column, DataGridCheckBoxColumn)
                     If Not oCheckBoxColumn Is Nothing Then
                        Dim oCheckBox = TryCast(oCell.Content, CheckBox)
                        If oCheckBox Is Nothing Then Continue For
                        AddHandler oCheckBox.Checked, AddressOf dgDataCheck_Checked
                        AddHandler oCheckBox.Unchecked, AddressOf dgDataCheck_Unchecked
                     End If
                  Next
               Next
            End If
            Return True
         Catch ex As Exception
            Call SF.TraceUtil.DoTrace(Infor.Blending.Admin.SharedFunctions.TraceCategoryEnum.Client, TraceEventType.Error, ex)
            Return False
         End Try

      End Function
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/eyIPnYRsDeI" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/eyIPnYRsDeI/d3b46a82-0fb9-4674-a3bb-e0e730bc70ee.aspx</link>
      <pubDate>Wed, 04 Feb 2009 13:19:13 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/d3b46a82-0fb9-4674-a3bb-e0e730bc70ee.aspx</feedburner:origLink></item>
    <item>
      <title>Get Site ID of IIS Site</title>
      <description>Description: Get Site ID of Website in IIS 6.0, Site ID is usually created automatically. save to .vbs file and doble click on it.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/f0ae6b76-e895-4e5a-8efc-c54c0f9ccc54.aspx'&gt;http://www.codekeep.net/snippets/f0ae6b76-e895-4e5a-8efc-c54c0f9ccc54.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Function ProcessWebSite(ServiceType, SiteNumber)
Set IISWebSite = getObject(&amp;quot;IIS://localhost/&amp;quot; &amp;amp; ServiceType &amp;amp; &amp;quot;/&amp;quot; &amp;amp; SiteNumber)
Set IISWebSiteRoot = getObject(&amp;quot;IIS://localhost/&amp;quot; &amp;amp; ServiceType &amp;amp; &amp;quot;/&amp;quot; &amp;amp; SiteNumber &amp;amp; &amp;quot;/root&amp;quot;)
ProcessWebSite = IISWebSite.ServerComment
Set IISWebSiteRoot = nothing
Set IISWebSite = Nothing
end function

Function ShowSites(ServiceType, ClassName, Title)
Wscript.echo &amp;quot;Web Sites Description&amp;quot;
Wscript.echo &amp;quot;===============================================================&amp;quot;
Set IISOBJ = getObject(&amp;quot;IIS://localhost/&amp;quot; &amp;amp; ServiceType)
for each Web in IISOBJ
if (Web.Class = ClassName) then
wscript.echo Ucase(ServiceType) &amp;amp; &amp;quot;/&amp;quot; &amp;amp; Web.Name &amp;amp; _
Space(17-(len(Ucase(ServiceType))+1+len(Web.Name))) &amp;amp; &amp;quot; &amp;quot; &amp;amp; _
ProcessWebSite(ServiceType, Web.name)
end if
next
Set IISOBj=Nothing
WScript.Echo &amp;quot;&amp;quot;
End function

Call ShowSites(&amp;quot;w3svc&amp;quot;, &amp;quot;IIsWebServer&amp;quot;, &amp;quot;Web&amp;quot;)&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/_aGlOGLUaUk" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/_aGlOGLUaUk/f0ae6b76-e895-4e5a-8efc-c54c0f9ccc54.aspx</link>
      <pubDate>Tue, 23 Dec 2008 13:22:05 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/f0ae6b76-e895-4e5a-8efc-c54c0f9ccc54.aspx</feedburner:origLink></item>
    <item>
      <title>Grabbing Browsers via ChildObjects in QTP</title>
      <description>Description: Quick and easy way to grab and iterate browsers in Windows without relying on CreationTime, which is unreliable.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/5c0f1210-26c9-4e68-98ec-36f26f6cf301.aspx'&gt;http://www.codekeep.net/snippets/5c0f1210-26c9-4e68-98ec-36f26f6cf301.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;

Dim objDesc 'As Description
Dim objBrowsers 'As Collection

Set objDesc = Description.Create
objDesc("micclass").Value = "Browser"
Set objBrowsers = Desktop.ChildObjects(objDesc)

'Zero-based collection
For lBrowserIndex = 0 to objBrowsers.Count - 1
	strTemp = (lBrowserIndex).GetROProperty(&amp;quot;hwnd&amp;quot;)  Then
	Set objBrowser = Nothing
Next

Set objBrowsers = Nothing
Set objDesc = Nothing
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/q0ShqLlOEyM" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/q0ShqLlOEyM/5c0f1210-26c9-4e68-98ec-36f26f6cf301.aspx</link>
      <pubDate>Mon, 18 Aug 2008 19:07:11 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/5c0f1210-26c9-4e68-98ec-36f26f6cf301.aspx</feedburner:origLink></item>
    <item>
      <title>Call and pass parameter to Web Service from VBScript</title>
      <description>Description: The code snippet calls and passes parameters to Web Service from VBScript&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/068096f5-1928-4180-9a30-d0ae5b57e2d8.aspx'&gt;http://www.codekeep.net/snippets/068096f5-1928-4180-9a30-d0ae5b57e2d8.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Dim oXMLDoc, oXMLHTTP
Sub btnCallWebService_Click()
		
	Set oXMLHTTP = CreateObject(&amp;quot;MSXML2.XMLHTTP.4.0&amp;quot;)
	Set oXMLDoc = CreateObject(&amp;quot;MSXML2.DOMDocument&amp;quot;)

	oXMLHTTP.onreadystatechange = getRef(&amp;quot;HandleStateChange&amp;quot;) 
	Dim strEnvelope 
	Set objPage = Item.GetInspector.ModifiedFormPages(&amp;quot;P.2&amp;quot;)
	Set objtxt1 = objPage.Controls(&amp;quot;TextBox1&amp;quot;)
	Set objtxt2 = objPage.Controls(&amp;quot;TextBox2&amp;quot;)
	strEnvelope = &amp;quot;a=&amp;quot; &amp;amp; objtxt1.value &amp;amp; &amp;quot;&amp;amp;b=&amp;quot; &amp;amp; objtxt2.value	

	call oXMLHTTP.open(&amp;quot;POST&amp;quot;,&amp;quot;http://localhost:3257/Service1.asmx/AddNumbers&amp;quot;,true)
	call oXMLHTTP.setRequestHeader(&amp;quot;Content-Type&amp;quot;,&amp;quot;application/x-www-form-urlencoded&amp;quot;)
	call oXMLHTTP.send(strEnvelope)
End Sub

Sub HandleStateChange
	if(oXMLHTTP.readyState = 4) then
		dim szResponse: szResponse = oXMLHTTP.responseText
		call oXMLDoc.loadXML(szResponse)
		if(oXMLDoc.parseError.errorCode &amp;lt;&amp;gt; 0) then
			call msgbox(&amp;quot;ERROR&amp;quot;)
			call msgbox(oXMLHTTP.responseText)
			call msgbox(oXMLDoc.parseError.reason)
		else
			call msgbox( oXMLDoc.getElementsByTagName(&amp;quot;string&amp;quot;)(0).childNodes(0).text)
		end if
	end if
End Sub


------------- OR --------------------

Sub btnCallWebService_Click()
	Dim oXml 
	Dim xmlDoc 		
	Dim strEnvelope 
	Set objPage = Item.GetInspector.ModifiedFormPages(&amp;quot;P.2&amp;quot;)
	Set objtxt1 = objPage.Controls(&amp;quot;TextBox1&amp;quot;)
	Set objtxt2 = objPage.Controls(&amp;quot;TextBox2&amp;quot;)
	Const strUrl = &amp;quot;http://localhost:3257/Service1.asmx/AddNumbers&amp;quot;

	strEnvelope = &amp;quot;a=&amp;quot; &amp;amp; objtxt1.value &amp;amp; &amp;quot;&amp;amp;b=&amp;quot; &amp;amp; objtxt2.value	
	
	Set oXml = CreateObject(&amp;quot;MSXML2.XMLHTTP&amp;quot;) 
	Set xmlDoc = CreateObject(&amp;quot;MSXML2.DOMDocument&amp;quot;) 
	
	oXml.open &amp;quot;POST&amp;quot;, strUrl, True
	call oXml.setRequestHeader(&amp;quot;Content-Type&amp;quot;,&amp;quot;application/x-www-form-urlencoded&amp;quot;)
	oXml.send(strEnvelope)
	
	MsgBox &amp;quot;Calling Web Service to add Nos&amp;quot;
	
	If oXml.Status = &amp;quot;200&amp;quot; Then 
		If xmlDoc.loadXML(oXml.responseText) Then 
			Msgbox xmlDoc.text
		End If 
	End If 
end sub&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/5jQzyjsgvlE" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/5jQzyjsgvlE/068096f5-1928-4180-9a30-d0ae5b57e2d8.aspx</link>
      <pubDate>Wed, 28 May 2008 02:49:26 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/068096f5-1928-4180-9a30-d0ae5b57e2d8.aspx</feedburner:origLink></item>
    <item>
      <title>Custom Action Service Depends</title>
      <description>Description: Sets a dependency for a Service&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/91047cb7-230c-4071-8c42-6a7409756728.aspx'&gt;http://www.codekeep.net/snippets/91047cb7-230c-4071-8c42-6a7409756728.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;'''
''' Set CustomActionData to [ProductName]&amp;lt;&amp;gt;boolBits
''' i.e. [ProductName]&amp;lt;&amp;gt;false
'''
Dim objWSH
Dim ProductName
Dim boolBits

'msgbox &amp;quot;CustomActionData: &amp;quot; &amp;amp; Session.Property(&amp;quot;CustomActionData&amp;quot;)

Args = Split(Session.Property(&amp;quot;CustomActionData&amp;quot;),&amp;quot;&amp;lt;&amp;gt;&amp;quot;)
ProductName = Args(0)
boolBits = Args(1)

'msgbox &amp;quot;ProductName: &amp;quot; &amp;amp; ProductName
'msgbox &amp;quot;boolBits: &amp;quot; &amp;amp; boolBits

Set objWSH = CreateObject(&amp;quot;WScript.Shell&amp;quot;)

If boolBits Then

objWSH.Run &amp;quot;%SystemRoot%\system32\reg.exe ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; ProductName &amp;amp; &amp;quot; /v DependOnService /d MSMQ\0BITS\0 /t REG_MULTI_SZ /F&amp;quot;, 7, False

Else

objWSH.Run &amp;quot;%SystemRoot%\system32\reg.exe ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\&amp;quot; &amp;amp; ProductName &amp;amp; &amp;quot; /v DependOnService /d MSMQ\0 /t REG_MULTI_SZ /F&amp;quot;, 7, False

End If

Set objWSH = Nothing&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/fINA7Pwgc3g" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/fINA7Pwgc3g/91047cb7-230c-4071-8c42-6a7409756728.aspx</link>
      <pubDate>Fri, 04 Apr 2008 08:24:59 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/91047cb7-230c-4071-8c42-6a7409756728.aspx</feedburner:origLink></item>
    <item>
      <title>Custom Action Service Set User/Pass</title>
      <description>Description: Set the username and password for a service&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/d5c3873c-c437-4ff7-9b80-c8c4e3df6876.aspx'&gt;http://www.codekeep.net/snippets/d5c3873c-c437-4ff7-9b80-c8c4e3df6876.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;'''
''' Set CustomActionData to [ProductName]&amp;lt;&amp;gt;UserName&amp;lt;&amp;gt;Password
''' i.e. [ProductName]&amp;lt;&amp;gt;GatewayScheduler&amp;lt;&amp;gt;password
'''
Dim objWSH
Dim ProductName
Dim UserName
Dim Password

'msgbox &amp;quot;CustomActionData: &amp;quot; &amp;amp; Session.Property(&amp;quot;CustomActionData&amp;quot;)

Args = Split(Session.Property(&amp;quot;CustomActionData&amp;quot;),&amp;quot;&amp;lt;&amp;gt;&amp;quot;)

ProductName = Args(0)
UserName = Args(1)
Password = Args(2)

'msgbox &amp;quot;ProductName: &amp;quot; &amp;amp; ProductName
'msgbox &amp;quot;UserName: &amp;quot; &amp;amp; UserName
'msgbox &amp;quot;Password: &amp;quot; &amp;amp; Password

Set objWSH = CreateObject(&amp;quot;WScript.Shell&amp;quot;)

objWSH.Run &amp;quot;%SystemRoot%\system32\sc.exe config &amp;quot; &amp;amp; ProductName &amp;amp; &amp;quot; obj= .\&amp;quot; &amp;amp; UserName &amp;amp; &amp;quot; password= &amp;quot; &amp;amp; Password, 7, False

Set objWSH = Nothing&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/vfbQIPc219M" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/vfbQIPc219M/d5c3873c-c437-4ff7-9b80-c8c4e3df6876.aspx</link>
      <pubDate>Fri, 04 Apr 2008 08:23:14 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/d5c3873c-c437-4ff7-9b80-c8c4e3df6876.aspx</feedburner:origLink></item>
    <item>
      <title>Customer Action Service Start</title>
      <description>Description: start a service&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/f9e99a0a-160b-4ea2-92ae-252a2c424dfa.aspx'&gt;http://www.codekeep.net/snippets/f9e99a0a-160b-4ea2-92ae-252a2c424dfa.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;'''
''' Set CustomActionData to [ProductName]
'''
Dim objWSH
Dim ProductName

'msgbox &amp;quot;CustomActionData: &amp;quot; &amp;amp; Session.Property(&amp;quot;CustomActionData&amp;quot;)

ProductName = Session.Property(&amp;quot;CustomActionData&amp;quot;)

'msgbox &amp;quot;ProductName: &amp;quot; &amp;amp; ProductName

Set objWSH = CreateObject(&amp;quot;WScript.Shell&amp;quot;)

objWSH.Run &amp;quot;%SystemRoot%\system32\sc.exe start &amp;quot; &amp;amp; ProductName, 7, False

Set objWSH = Nothing&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/A1EfFCWPK6I" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/A1EfFCWPK6I/f9e99a0a-160b-4ea2-92ae-252a2c424dfa.aspx</link>
      <pubDate>Fri, 04 Apr 2008 08:21:54 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/f9e99a0a-160b-4ea2-92ae-252a2c424dfa.aspx</feedburner:origLink></item>
    <item>
      <title>To fetch the values from DB and save it to a xls sheet.</title>
      <description>Description: This will allow the User to grab the value from the DB and export the same to the Excel sheet.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/988fe59e-a7d9-4988-a021-788074316657.aspx'&gt;http://www.codekeep.net/snippets/988fe59e-a7d9-4988-a021-788074316657.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Set con = createobject(&amp;quot;Adodb.Connection&amp;quot;)
 Set rs = CreateObject(&amp;quot;Adodb.Recordset&amp;quot;)
 
 con.open &amp;quot;Provider=SQLOLEDB;server=CQDB\TESTING;database=CQDS_5.5.2_VERITAS;user id=sa	;password=unknown;Connect Timeout=30&amp;quot;
 if(err.number &amp;lt;&amp;gt;0) then
 msgbox &amp;quot;Error&amp;quot;
 else 
 msgbox &amp;quot;Works fine&amp;quot;
 msgbox &amp;quot;Connected&amp;quot;
 End if
 
 
 rs.open &amp;quot;select  *  from cqt_user&amp;quot;,con
 
 rs.MoveFirst
 
 
 For i = 0 to rs.Fields.count-1
 DataTable.GlobalSheet.AddParameter rs.Fields(i).Name,&amp;quot;&amp;quot;
 
 Next
 
 c=1

 ''Add records to the datatable.
 
 Do until rs.Eof
 DataTable.SetCurrentRow(c)
 For j = 1 to rs.Fields.Count
 
 DataTable.Value(j,dtglobalsheet) = rs(j-1)
 
 Next
 rs.MoveNext
 c=c+1
 Loop
'''''''Then If you are using QTP you can call this function &lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/YyBEW8TAkQA" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/YyBEW8TAkQA/988fe59e-a7d9-4988-a021-788074316657.aspx</link>
      <pubDate>Wed, 05 Dec 2007 11:28:48 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/988fe59e-a7d9-4988-a021-788074316657.aspx</feedburner:origLink></item>
    <item>
      <title>Open the excel sheet and insert some column values along with formatting.</title>
      <description>Description: TO open the excel sheet and insert some column values along with formatting.This function can be used. it helps all who work on QTP as this is what they should do for logging.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/2d415c9e-585c-40e2-a4f7-638c08063e75.aspx'&gt;http://www.codekeep.net/snippets/2d415c9e-585c-40e2-a4f7-638c08063e75.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Dim objXL
Set objXL = CreateObject(&amp;quot;Excel.Application&amp;quot;)
 
objXL.Visible = TRUE
 
objXL.WorkBooks.Add
 
 
objXL.Columns(1).ColumnWidth = 20
objXL.Columns(2).ColumnWidth = 30
objXL.Columns(3).ColumnWidth = 40
 
objXL.Cells(1, 1).Value = &amp;quot;Property Name&amp;quot;
objXL.Cells(1, 2).Value = &amp;quot;Value&amp;quot;
objXL.Cells(1, 3).Value = &amp;quot;Description&amp;quot;
 
objXL.Range(&amp;quot;A1:C1&amp;quot;).Select
objXL.Selection.Font.Bold = True
objXL.Selection.Interior.ColorIndex = 1
objXL.Selection.Interior.Pattern = 1 'xlSolid
objXL.Selection.Font.ColorIndex = 2   
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/luY8hLU0rq0" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/luY8hLU0rq0/2d415c9e-585c-40e2-a4f7-638c08063e75.aspx</link>
      <pubDate>Wed, 05 Dec 2007 11:25:32 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/2d415c9e-585c-40e2-a4f7-638c08063e75.aspx</feedburner:origLink></item>
    <item>
      <title>Get all the links</title>
      <description>Description: This function will get all the links or by modifying you can get any type of objects from a web page. &lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/4c8e9b9a-8cc1-4ad8-b9ca-9272f68550bb.aspx'&gt;http://www.codekeep.net/snippets/4c8e9b9a-8cc1-4ad8-b9ca-9272f68550bb.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Dim l_objPage 'Holds Page object 
Dim l_objTag 'Holds &amp;quot;A&amp;quot; Tag Object 
Dim l_intTotalLink 'Holds Total Link 
Dim l_intCtr 'Holds FOR counter 
Dim l_strLink 'Holds Link Name 
Dim l_strHref 'Holds Href 
Set l_objPage = Browser(&amp;quot;Title:=BrowserTitle.*&amp;quot;).Page(&amp;quot;Title:=BrowserTitle.*&amp;quot;).Object 
Set l_objTag = l_objPage.GetElementsByTagName(&amp;quot;A&amp;quot;) 
l_intTotalLink = l_objTag.Length - 1 
For l_intCtr = 0 to l_intTotalLink 
     l_strLink = l_objTag(l_intCtr).InnerText 
     l_strHref = l_objTag(l_intCtr).Href 
     If l_strLink = &amp;quot;Contact Us&amp;quot; Then 
        l_strLink(l_intCtr).Click 
Next &lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/U1_w7ZiHrg8" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/U1_w7ZiHrg8/4c8e9b9a-8cc1-4ad8-b9ca-9272f68550bb.aspx</link>
      <pubDate>Wed, 05 Dec 2007 11:23:33 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/4c8e9b9a-8cc1-4ad8-b9ca-9272f68550bb.aspx</feedburner:origLink></item>
    <item>
      <title>network drive</title>
      <description>Description: script to map network drive&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/06a6a955-5fec-4e5a-a1b5-6c907624686c.aspx'&gt;http://www.codekeep.net/snippets/06a6a955-5fec-4e5a-a1b5-6c907624686c.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;dim wshnetwork
set wshnetwork=Wscript.CreateObject(&amp;quot;Wscript.network&amp;quot;)
set wshnetwork=Wscript.CreateObject(&amp;quot;Wscript.shell&amp;quot;)
Wscript.sleep 3000
wshnetwork.MapNetworkDrive &amp;quot;w:&amp;quot;,&amp;quot;\\192.168.1.1\&amp;quot;&amp;amp;wshnetwork.usern&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/MEdNL40T1lI" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/MEdNL40T1lI/06a6a955-5fec-4e5a-a1b5-6c907624686c.aspx</link>
      <pubDate>Thu, 22 Nov 2007 17:04:09 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/06a6a955-5fec-4e5a-a1b5-6c907624686c.aspx</feedburner:origLink></item>
    <item>
      <title>Get Script Directory</title>
      <description>Description: Gets the directory path (with a trailing slash) for the VB Script File.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/46e72221-bf1b-41a2-ad7e-ae3680debe33.aspx'&gt;http://www.codekeep.net/snippets/46e72221-bf1b-41a2-ad7e-ae3680debe33.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;scriptFullName = WScript.ScriptFullName

scriptPath = Left ( scriptFullName, _
	InStrRev ( scriptFullName, WScript.ScriptName) - 1 )

WScript.Echo scriptPath&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/XmCIO1AT86Q" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/XmCIO1AT86Q/46e72221-bf1b-41a2-ad7e-ae3680debe33.aspx</link>
      <pubDate>Mon, 17 Sep 2007 11:03:43 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/46e72221-bf1b-41a2-ad7e-ae3680debe33.aspx</feedburner:origLink></item>
    <item>
      <title>Export VBA Modules</title>
      <description>Description: VBScript code to export class and standard VBA modules from an MS Office document.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/c27c511d-5c8b-4b4f-8411-ba36ca58a7d0.aspx'&gt;http://www.codekeep.net/snippets/c27c511d-5c8b-4b4f-8411-ba36ca58a7d0.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;'directory for exported files
targetDir = &amp;quot;C:\Exported VBA Files&amp;quot;

targetDir = Trim  ( targetDir )

Set fso = WScript.CreateObject ( &amp;quot;Scripting.FileSystemObject&amp;quot; )
If Not fso.FolderExists ( targetDir ) Then
	fso.CreateFolder targetDir
End If


If Right(targetDir, 1) &amp;lt;&amp;gt; &amp;quot;\&amp;quot; Then
	targetDir = targetDir &amp;amp; &amp;quot;\&amp;quot;
End If

'the progid of a running office application
progId = &amp;quot;Visio.Application&amp;quot;

Set app = GetObject ( , progId )

Set doc = app.ActiveDocument
Set comps = doc.VBProject.VBComponents

For Each comp In comps
	
	'class modules
	If comp.Type = 2 Then
		
		comp.Export targetDir &amp;amp; comp.Name &amp;amp; &amp;quot;.cls&amp;quot;

	'standard modules
	ElseIf Comp.Type = 1 Then

		comp.Export targetDir &amp;amp; comp.Name &amp;amp; &amp;quot;.bas&amp;quot;

	'document code-behind
	ElseIf Comp.Type = 100 Then	

		comp.Export targetDir &amp;amp; comp.Name &amp;amp; &amp;quot;.cls&amp;quot;
	
	End If


Next

WScript.Echo &amp;quot;Done&amp;quot;
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/k69WZT0xW7E" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/k69WZT0xW7E/c27c511d-5c8b-4b4f-8411-ba36ca58a7d0.aspx</link>
      <pubDate>Mon, 03 Sep 2007 00:31:13 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/c27c511d-5c8b-4b4f-8411-ba36ca58a7d0.aspx</feedburner:origLink></item>
    <item>
      <title>ConvertRecordSetToString</title>
      <description>Description: Converting RecordSet To String&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/3b908fa3-ca23-4c31-9539-d4c79805ae94.aspx'&gt;http://www.codekeep.net/snippets/3b908fa3-ca23-4c31-9539-d4c79805ae94.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;Function ConvertRecordSetToString(objRS)
	Dim strContent
	Dim objField, intFields
	If IsObject(objRS) AND objRS.RecordCount &amp;gt; 0 Then
		objRS.MoveFirst
		For intFields = 0 To objRS.Fields.Count - 1
			strContent = strContent &amp;amp; objRS.Fields.Item(intFields).Name &amp;amp; &amp;quot;,&amp;quot;
		Next
		strContent = strContent &amp;amp; VbCrLf
		Do While NOT objRS.EOF
			For intFields = 0 To objRS.Fields.Count - 1
				Set objField = objRS.Fields.Item(intFields)
				If IsNull(objField.Value) = False Then
					If IsNumeric(objField.Value) Then
						strContent = strContent &amp;amp; Replace(Trim(objField.Value), &amp;quot;,&amp;quot;, &amp;quot;&amp;quot;) &amp;amp; &amp;quot;,&amp;quot;
					Else
						strContent = strContent &amp;amp; Replace(Trim(objField.Value), &amp;quot;,&amp;quot;, &amp;quot; &amp;quot;) &amp;amp; &amp;quot;,&amp;quot;
					End If
				Else
					strContent = strContent &amp;amp; objField.Value &amp;amp; &amp;quot;,&amp;quot;				
				End If
			Next
			strContent = strContent &amp;amp; VbCrLf
			objRS.MoveNext
		Loop
	End If
	ConvertRecordSetToString = strContent
End Function&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepVBScript/~4/nuE5A8VfxPk" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/CodeKeepVBScript/~3/nuE5A8VfxPk/3b908fa3-ca23-4c31-9539-d4c79805ae94.aspx</link>
      <pubDate>Tue, 10 Jul 2007 03:24:26 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/3b908fa3-ca23-4c31-9539-d4c79805ae94.aspx</feedburner:origLink></item>
  </channel>
</rss>

