416-993-4953

32 Grenville Street M4Y 1A3

CPRGreaves@gmail.com

Home

Christopher Greaves

The Word Utility Function Library

I urge you to develop libraries of code, or to use mine. Your applications will exhibit fewer errors when you use previously tested code. Write a utility function once, place it in a library, and use it across many applications.

Youíd like to do it yourself? I offer Training in all aspects of VBA, from the syntax of the language, to the techniques that professional programmers use to avoid programming problems. Things they donít teach you in business schools; itís more than just programming.

Ask me about custom functions to suit your needs in Excel, Word, Outlook, Access, PowerPoint or Project.

Whatís Your Problem? I have a VBA function solution, or can deliver one by email to your office.

Extended table of technical characteristics

How To Use This Table

About Self-Testing Functions

About Self-Delimited Strings

Module

Procedure

Description

Uses

modDPNE

strExtractDrivePath

Extract the drive and path from a valid FullName string.

InStrRev97 ; strFixPath

modDPNE

strExtractNameExtent

Extract the name and extent from a valid FullName string.

InStrRev97

modDPNE

strGetExtent

Extract the extent from a valid FullName string.

strExtractNameExtent ; InStrRev97

modDPNE

strGetName

Extract the name from a valid FullName string.

strExtractNameExtent ; InStrRev97

modDPNE

strUNCGetDrive

Extract the UNC or local drive from a valid FullName string.

(none)

modFileHandling

blnKillFile

Return TRUE if able to Kill the file, optionally ask the user.

blnFileExists

modFileHandling

KillFile

Delete a file, with an optional prompt to the end-user.

blnFileExists

modFileHandling

MakeShortcut

Make a shortcut link to a file.

modFileHandling

PrintFile

Append a message to a file.

(none)

modFileHandling

PutFileData

Output a string to a file.

blnKillFile

modFileHandling

ReduceFileSize

Reduce the size of a file after it exceeds some limit.

strSplitAt

modFileHandling

strGetFileData

Input a string from a file.

blnFileExists

modFoldersAndPaths

blnFolderExists

Return TRUE if the given folder can be found.

FileSystemObject

modFoldersAndPaths

strFixPath

Append a path separator if one does not exist.

(none)

modFoldersAndPaths

strMakePath

Ensures that the path/folder exists.

strSplitStringAt , blnFolderExists

modFoldersAndPaths

strValidatePathString

Validate the input string and return a string of error flags.

(none)

modImages

ImageFileFromAscii

Deliver an image file FROM a delimited ascii string.

PutFileData

modImages

ImageFileFromAsciiArray

Deliver an image file FROM an array of delimited ascii strings.

PutFileData

modImages

strAsciiFromImageFile

Deliver an image file TO a delimited ascii string.

strGetFileData

modImages

strAsciiFromImageFile

Deliver an image file TO a delimited ascii string.

strGetFileData

modLogging

AMLog

Log a message to several places at once.

strEnvironmentPath ; strApplication ; blnFileExists ; ReduceFileSize ; PrintFile ; strDateTime

modLongHandling

lngMin

Returns the minimum of two numbers.

(none)

modMarginsPageLevel

blnFileExists

Return TRUE if a file exists.

(none)

modMarginsPageLevel

ResetMarginsInSection

Set the given margins in the given section.

SetMarginInRange

modMarginsPageLevel

ResetPageMarginsFromTable

Table-driven reset styles in all sections of a document.

ResetMarginsInSection

modMarginsPageLevel

SetMarginInRange

Set the given margin in the given range.

(none)

modModules

blnAddModule

Return TRUE if a specific module is added to the document.

(none)

modModules

blnDeleteModule

Return TRUE if a specific module is found and deleted.

(none)

modModules

blnModuleExistsInDocument

Return TRUE if a specific module is found.

(none)

modModules

LoadModuleFromStringArray

Load the string array, line by line, INTO the named existing module.

(none)

modModules

LoadModuleToStringArray

Load the string array, line by line, FROM the named existing module.

(none)

modPageOrientation

InsertSectionBreaksLong

Insert two page setup section breaks around the selection and set the orientation.

(none)

modPageOrientation

InsertSectionPageBreakShort

Insert a page setup section break at the selection point.

(none)

modPageOrientation

LandscapeSection

Set orientation to Landscape in the given section.

(none)

modPageOrientation

PortraitSection

Set orientation to Portrait in the given section.

(none)

modPageOrientation

ToggleSection

Toggle the orientation in the given section.

LandscapeSection , PortraitSection

modProjectData

blnChannelExists

Returns TRUE if the case-insensitive document variable exists in the given document.

lngIndexDocumentVariables

modProjectData

blnIAmAtHome

Determine if I am running on my development machine.

blnFolderExists

modProjectData

ChannelPutTo

Stores a variant value in a document variable.

(none)

modProjectData

CheckVersion

Valiant attempt to keep version numbers up to date.

blnIAmAtHome ; strGetName ; strDigitsOnly ; varChannelGetFrom ; ChannelPutTo

modProjectData

lngIndexDocumentVariables

Returns the index to a custom document property (a "variable") in the named document.

(none)

modProjectData

varChannelGetFrom

Retrieves a variant value from a document variable.

blnChannelExists

modStringGeneration

strWhoAmI

Deliver the full description of a file in a formatted string.

modStringGeneration

strWhoAmIProjectDateTime

Deliver the time stamp of a file in a formatted string.

modStringGeneration

strWhoAmIProjectFullName

Deliver the full name of a file in a formatted string.

modStringGeneration

strWhoAmIProjectName

Deliver the project name of a file in a formatted string.

modStringGeneration

strWhoAmIProjectVersion

Deliver the stored version number of a file in a formatted string.

modStringHandling

blnAlphaOnly

Returns TRUE if the given string contains only alphabetic characters. Useful cover function for strOnly.

strOnly

modStringHandling

BuildAssignmentFromString

Load the string array, line by line, with a series of VBA statements.

ChunkMyData

modStringHandling

ChunkMyData

Breaks a string into a string array, each element within a maximum length constraint.

strSplitBefore

modStringHandling

InStrRev97

Word97 implementation of InStrRev

(none)

modStringHandling

SplitToNE

Split the input string to a name and an extent, if any.

modStringHandling

strAlphaDigitsOnly

Returns only alphabetic (52) and decimal (10) characters from strIn.Useful cover function for strOnly.

strOnly

modStringHandling

strAlphaOnly

Returns only alphabetic (52) characters from strIn. Useful cover function for strOnly.

strOnly

modStringHandling

strDateTime

Return a formatted ("yyyymmdd", "hhmmss") string, OPTIONALLY of a given date and time.

(none)

modStringHandling

strDigitsOnly

Returns only decimal digit characters from strIn. Useful cover function for strOnly.

strOnly

modStringHandling

strOnly

Returns only those characters in strIn which can be found in strRef.

(none)

modStringHandling

strRemoveDuplicates

Remove duplicate character (strings) from a given string.

modStringHandling

strSplitAt

Obtain the leading (leftmost) portion of a string.

(none)

modStringHandling

strSplitBefore

Uses the leading character as a delimiter. Returns a string split off, including the delimiter at the leading, but not the trailing, end.

(none)

modStringHandling

strSplitStringAt

Return the leading (leftmost) or trailing (rightmost) portion of a string.

(none)

modStyles

blnStyleFoundInUseInRange

Return TRUE if there exsist at least one paragraph styled in this style.

(none)

modStyles

CloneOldStyleToNewStyle

Make a clone of the old style and name it as the new.

(none)

modStyles

lngDeleteStyleDefinition

Remove a style definition from the document.

lngStyleDefinedInDocument

modStyles

lngRenameStyleInUse

Rename the definition and all use of a given style.

CloneOldStyleToNewStyle , lngRestyleAllParagraphs

modStyles

lngRestyleAllParagraphs

Change the assignment of styles for paragraphs.

(none)

modStyles

lngStyleDefinedInDocument

Return the numeric index of a style definition in a document; -1 means undefined.

(none)

modStyles

lngStyleFoundInUseInRange

Return the count of paragraphs using this style in the given range.

(none)

modStyles

RenameStylesFromTable

Table-driven Rename all use of a given style in a document.

lngRenameStyleInUse

modStyles

RestartListNumbering

Restarts list numbering, 97-XP, all list implementations

modStyles

SetStyle

Sets the style of all paragraphs in the selection.

(none)

modTableCells

strCellText

Return the text contents of a cell range.

(none)

ModUserData

strApplication

Obtain the leading alphabetic characters of a file name.

(none)

ModUserData

strEnvironmentPath

Return the path to the application document's user data folder.

strFixPath , strMakePath

ModUserData

strGetEnvVar

Get a local key value.

GetPrivateProfileString, WritePrivateProfileString

ModUserData

strGPAdoc

Obtain a parameter from an application's user data area.

strGetEnvVar

ModUserData

strINIFileName

Given an OPTIONAL application name, return the INI file name.

strEnvironmentPath , strApplication , strGetExtent, strMakePath , PutFileData

ModUserData

strPPAdoc

Write a parameter to an application's user data area.

strPutEnvVar

ModUserData

strPutEnvVar

Write a local key value.

WritePrivateProfileString


Loading

416-993-4953 CPRGreaves@gmail.com

Toronto, Wednesday, January 25, 2017 2:39 PM

Copyright © 1996-2017 Chris Greaves. All Rights Reserved.