Results 1 to 1 of 1
Thread: utility library (Word97/SR2)
2002-05-30, 21:32 #1
- Join Date
- Feb 2001
- Yilgarn region of Toronto, Ontario
- Thanked 0 Times in 0 Posts
utility library (Word97/SR2)
Storing a <A SEARCH=1 HREF="dosearch.pl?Forum=All_Forums&Match=Enti re+Phrase&Old=allposts&Words=utility+library" >utility library[/url] in the form of a Word template - Utils.dot - in my startup folder is the best thing that's happened to me since the previous best thing.
I'm writing this note in case anyone else out there is accumulating a slew of general-purpose functions and spending time copy-pasting in, or starting each new application with a renamed copy of their current Utils.dot.
see also this thread
1) Four years ago I wrote a Word6 WordBasic template Faxmacs.dot whose sole purpose was to obtain data from a comma-delimited file exported from my DOS name-and-address file, and to format it into the address list format used by QuickLink II. The names don't really matter, just that I used WordBasic to effect a data interface between two uncommunicative data stores.
2) Two years ago, or maybe only last year, I re-wrote Faxmacs.dot in VBA. Still stand-alone, still merges the existing QuickLink address list with a comma-delimited file, removes duplicates, and writes it back to the QuickLink address list.
3) Two months ago Gary Frieder et al. pointed me in the direction of storing my Utils.dot in Startup. It works fine, and I'm in the process of re-vamping my VBA offerings (new web site was loaded this morning - go to the Home Page and look for the last item "VBA Utilities", I think it's called).
4) This morning I decided to add a "fax" button to my Access97 database form. I figured that as long as I was spitting out a form letter from Word97 with the address, it'd make sense to load the fax number into the QuickLink fax address list.
I drag my Faxmacs.dot into my Startup directory, where it now rubs shoulders with Utils.dot, add a reference to Faxmacs in my Word97 template, and craft the little routine you see pasted below.
Inspect the three bolded lines.
There! wasn't that easy!
<font color=red>Thanks again to the gurus and peers at http://www.wopr.com</font color=red>
<pre>Sub AugmentFaxList(strGroup As String, strBusiness As String, strPerson As String, strFaxNumber As String)
Dim strAr() As String
ReDim strAr(4, 0)
Dim strFaxFile As String
strFaxFile = "c:ql2faxwfaxphone.lst"
' Load the existing phone list to the array
Call Fax.boolLstToArray(strFaxFile, strAr)
' Augment the array with one row of supplied data
strAr(0, UBound(strAr, 2)) = strGroup
strAr(1, UBound(strAr, 2)) = strBusiness
strAr(2, UBound(strAr, 2)) = strFaxNumber
strAr(3, UBound(strAr, 2)) = strPerson
' Strip any duplicates
Call Fax.lngDropDuplicateRows(strAr, 0, 1, 2)
' Write the list back to the file
Call Fax.boolArrayToLST(strFaxFile, strAr)