Categories




font exists

Public Function FontExists(FontName As String) As Boolean
Dim oFont As New StdFont
Dim bAns As Boolean
oFont.Name = FontName
bAns = StrComp(FontName, oFont.Name, vbTextCompare) = 0
FontExists = bAns
End Function

Private Sub Form_Load()
MsgBox FontExists(“ARIAL”)
End Sub

Bookmark It

Hide Sites

$$(‘div.d94′).each( function(e) { e.visualEffect(’slide_up’,{duration:0.5}) }); [...]

File system object example

‘Add a list box to the form and then add a reference to the Microsoft Scripting Runtime

Private Sub Form_Load()
Dim fldr As Folder
Dim fso As New FileSystemObject
Dim drv As Drive
Set drv = fso.GetDrive(fso.GetDriveName(“d:”))
With List1
.AddItem “Available space: ” & FormatNumber(drv.AvailableSpace / 1024, 0) & ” BK”
.AddItem “Drive letter: ” [...]

Display the filesystem of a drive

‘Add a list box to the form and then add a reference to the Microsoft Scripting Runtime

Private Sub Form_Load()
Dim fldr As Folder
Dim fso As New FileSystemObject
Dim drv As Drive
Set drv = fso.GetDrive(fso.GetDriveName(“d:”))
MsgBox (“File system is ” & drv.FileSystem)

End Sub

Bookmark It

Hide Sites

$$(‘div.d92′).each( function(e) { e.visualEffect(’slide_up’,{duration:0.5}) });

check whether a file exists

Private Sub Form_Load()

Dim objfso As New FileSystemObject
If objfso.FileExists(“f:test.txt”) Then
MsgBox “The file exists”, vbInformation
Else
MsgBox “The file does not exist”, vbInformation
End If

End Sub

Bookmark It

Hide Sites

$$(‘div.d91′).each( function(e) { e.visualEffect(’slide_up’,{duration:0.5}) });