|
|
|
|
Send Email using CDOSYS.
|
Total Hit (4302) |
This code snippet will show you how to send SMTP email using CDOSYS. CDONTS was old library for Win NT which is discontinued in XP and 2000. CDOSYS is more flexible than CDONTS. The follwoing code will work with VB6 and VB.net without any modification.
From this code you will learn
1) How to a
....Read More |
Rating
|
|
|
|
|
|
|
|
|
|
|
|
ArrayShuffle - Randomize the order of elements in an array
|
Total Hit (3515) |
«Code LangId=1»
' Shuffle the elements of an array of any type
' (it doesn't work with arrays of objects or UDT)
Sub ArrayShuffle(arr As Variant)
Dim index As Long
Dim newIndex As Long
Dim firstIndex As Long
Dim itemCount As Long
Dim tmpValue As Variant
firs
....Read More |
Rating
|
|
|
Split2 - A Split variant that parses multiple lines of text
|
Total Hit (1774) |
«Code LangId=1»
' A Split variant that parses a string that contains
' row and column separators, and returns a 2-dimensional array
'
' the result String array has a number of columns equal
' to the highest number of fields in individual text lines
Function Split2(ByVal Text As String, Opti
....Read More |
Rating
|
|
|
Determine whether a program is 16- or 32-bit
|
Total Hit (3407) |
Even if we're living in a 32-bit world, and closer and closer to the 64-bit day, 16-bit programs are still running out there. Knowing whether a given EXE is 32-bit or not can be useful when you have to arrange version checking routine, for example to detect which version of a product is installed.
....Read More |
Rating
|
|
|
Get the list of ODBC DSNs (Using ODBCTOOL.DLL)
|
Total Hit (7685) |
The ODBCTOOL.DLL library contains three functions that make it easier to manage DSNs. To run the following code you must add a reference to the "ODBC Driver & Data Source Name Functions" library to your References dialog box. If you don't find this library listed in the References list, use the Star
....Read More |
Rating
|
|
|
Check a GUID
|
Total Hit (2999) |
The following routine quickly check that a string contains a valid GUID. Of course, it doesn't check that the GUID refers to a valid entity, but at least it lets you quickly reject invalid values:
«Code LangId=1»
Function CheckGUID(Value As String) As Boolean
Const PatternGUID = "{#######
....Read More |
Rating
|
|
|
Let the user insert OLE objects in a RichTextBox control
|
Total Hit (2657) |
A little-known feature of the RichTextBox control allows you to insert an OLE object in the text being edited. However, you can do so only programmatically, by adding an element to the OleObjects collection. An easy way to let the user select the object to be embedded in the control is using the Ins
....Read More |
Rating
|
|
|
Suppress TreeView's tooltips
|
Total Hit (3601) |
By default, all TreeView controls whose version number is 4.70 or higher display the text of the node under the cursor if the node itself isn't completely visible. You can turn off and on this feature by resetting a bit in the control's style, using the following code:
«Code LangId=1»
Private
....Read More |
Rating
|
|
|
Implement a MaxLength property for the ComboBox control
|
Total Hit (2214) |
Unlike the TextBox control, the ComboBox control doesn't expose any MaxLength property, so you have no means of limiting the numbers of characters typed by the end user in the edit area. However you can set this value by sending a CB_LIMITTEXT message to the control, passing the maximum number of ch
....Read More |
Rating
|
|
|
Load a text file in one operation
|
Total Hit (2954) |
The fastest way to read a text file is using the Input$ function, as shown in this reusable procedure:
«Code LangId=1»
Function FileText (filename$) As String
Dim handle As Integer
handle = FreeFile
Open filename$ For Input As #handle
FileText = Input$(LOF(handle), handle)
....Read More |
Rating
|
|
|
Testing a key in a PropertyBag without raising an error
|
Total Hit (3158) |
When you pass a non-existing key to the WriteProperty method of the PropertyBag object you get an error 327 "Data value named 'namekey' not found". This is more or less the same error - albeit with a different error code - that you receive when you pass an non-existing key to the Item method of a Co
....Read More |
Rating
|
|
|
How to resize window accurately to get desired client area ?
|
Total Hit (7692) |
Sometimes you might get unexpected window size when you resize or assign different height or width. To resize or change window height/width accurately based on required client area you can use AdjustWindowRect or AdjustWindowRectEx api. You can pass required client area as a RECT parameter to Adjus
....Read More |
Rating
|
|
|
How To Start a Process as Another User from Visual Basic
|
Total Hit (7178) |
This article shows you how to programmatically start a process as another user from Microsoft Visual Basic. To do this, you can use the LogonUser and CreateProcessAsUser Win32 APIs on a computer that is running Microsoft Windows NT 4.0, or you can use the CreateProcessWithLogonW Win32 API on a compu
....Read More |
Rating
|
|
|
How to Cancel Printing job sent to Printer.
|
Total Hit (3161) |
To learn more about Printing Using API click on the folloing link
«a href='http://msdn.microsoft.com/library/en-us/gdi/prntspol_0r1j.asp'»http://msdn.microsoft.com/library/en-us/gdi/prntspol_0r1j.asp«/a»
|
Rating
|
|
|
Determining Free Disk Space in Win95/Win98 with GetDiskFreeSpace
|
Total Hit (885) |
The routine presented here to determine a drive's available disk space will return incorrect results on volumes over 2 gigabytes, as supported by the FAT32 partitions implemented in Windows95 OEM Service Pack 2, Windows 98 (without FAT32 conversion) and NT4. See the comments section following the co
....Read More |
Rating
|
|
|
Creating a Ledger-Style Listview Report Background
|
Total Hit (1216) |
This page takes a different approach based on the Picture property of the VB5 and VB6 listviews. With this demo, picture box properties are set to match the size and font of the listview. The demo then draws two filled rectangles inside the picture box corresponding to ledger colours specified, and,
....Read More |
Rating
|
|
|
|
vbAccelerator Toolbar and CoolMenu Control v3.5
|
Total Hit (2311) |
This control allows you to create modern UIs like Internet Explorer or Word with full colour-depth toolbars, CoolMenus, resizable and movable toolbar bands, controls in the toolbar and much more. It works with standard forms and MDI forms and also allows you to create Outlook-style MDI applications
....Read More |
Rating
|
|