This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function IsWordDocument(ByVal strExtension As String) As Boolean | |
' Developed by Warren Bain on 01/04/2010 | |
' Copyright (c) Thought Croft Pty Ltd | |
' All rights reserved. | |
' Verifies if the supplied file extension e.g. "doc" | |
' is recognised as one of the documents that this version | |
' of Word can natively handle. List is constructed from the | |
' types of documents that can be filtered in the Open File dialog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function IsFileOpen(ByVal strFullPathFileName As String) As Boolean | |
' Attempting to open a file for ReadWrite that exists will fail | |
' if someone else has it open. We also have to guard against the | |
' errors that occur if the file has uncommon file attributes such as | |
' 'hidden' which can upset the Open statement. | |
' NOTE: any open that doesn't lock the file such as opening a .txt file | |
' in NotePad or a read-only file open will return False from this call. | |
Dim lngFile As Long |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function GeneratePassword( _ | |
ByVal intLength As Integer) As String | |
' Generates a random string of digits of the requested length | |
' In: | |
' intLength - number of digits to be returned (max 9) | |
' Out: | |
' Return Value - a random string of digits | |
' Example: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Class for defining an application state which can be | |
' saved and restored using the AppStateMgr class | |
' Developed by Warren Bain on 16/11/2006 | |
' Copyright (c) Thought Croft Pty Ltd | |
' http:\\www.thoughtcroft.com | |
' All rights reserved. | |
Option Explicit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Note: VBA6 is a conditional compiler constant that indicates | |
' the version of VBA and in this module we use enumerated types if | |
' supported otherwise we use plain old public constants | |
#If CBool(VBA6) Then | |
' Enumerate methods for selecting mode of character removal | |
Public Enum StripCharsMode | |
scmcRemoveAlphas = 2 ^ 0 | |
scmcRemoveControl = 2 ^ 1 | |
scmcRemoveNumerics = 2 ^ 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim MyNewMailHandler As clsNewMailHandler | |
Private Sub Application_Quit() | |
Set MyNewMailHandler = Nothing | |
End Sub | |
Private Sub Application_Startup() | |
Set MyNewMailHandler = New clsNewMailHandler | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Sub CopyExcelData( _ | |
ByRef wkbSource As Object, _ | |
ByRef wkbTarget As Object, _ | |
Optional ByVal blnCopyEmptyCells As Boolean = True) | |
'*** Change to remove control chars as it crashes Excel 97 ***' | |
' Copy all data entry cells from one workbook | |
' to the other assuming that a data entry cell | |
' is: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private rps As ReportPrintStatus | |
Private Sub Report_Close() | |
If rps.Printed Then | |
' Do something | |
End If | |
End Sub | |
Private Sub Report_Open(Cancel As Integer) | |
' Sink the reports events so we can determine if it was printed or not |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Enum TextEditMode | |
temcInvalid = 0 | |
temcLockedTrue = 2 ^ 0 | |
temcLockedFalse = 2 ^ 1 | |
temcEnabledTrue = 2 ^ 2 | |
temcEnabledFalse = 2 ^ 3 | |
temcEnterWithEdit = temcLockedFalse + temcEnabledTrue | |
temcEnterNoEdit = temcLockedTrue + temcEnabledTrue | |
temcNoEnterNormal = temcLockedTrue + temcEnabledFalse | |
temcNoEnterDimmed = temcLockedFalse + temcEnabledFalse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Enum ControlNameFormat | |
cnfcShortPropertyName | |
cnfcLongHierarchicalName | |
End Enum | |
Public Function GetSubFormControlName( _ | |
ByRef frm As Form, _ | |
Optional ByVal NameFormat As ControlNameFormat = _ | |
cnfcShortPropertyName) As String |
NewerOlder