<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-28738321</id><updated>2011-12-14T18:55:05.985-08:00</updated><title type='text'>Utility Library (VB/VBA)</title><subtitle type='html'>My background in application development has taught me to use libraries of utility procedures to speed up my development.
This blog documents the new and the more commonly-used existing functions that can be found in my UW.DOT and UX.XLS libraries.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>22</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-28738321.post-115403024909478600</id><published>2007-12-31T12:59:00.000-08:00</published><updated>2006-07-27T12:57:55.303-07:00</updated><title type='text'>Images</title><content type='html'>(See the full text with images at &lt;a href="http://www.chrisgreaves.com/BlogUtils/"&gt;http://www.chrisgreaves.com/BlogUtils/&lt;/a&gt;)&lt;br /&gt;Available in my UW.DOT library.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-115403024909478600?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/115403024909478600/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=115403024909478600' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115403024909478600'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115403024909478600'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2007/12/images.html' title='Images'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-6714147862125976134</id><published>2007-09-18T04:32:00.000-07:00</published><updated>2007-09-18T04:34:51.299-07:00</updated><title type='text'>"edit undo" for a GUI form</title><content type='html'>&lt;a href="http://www.chrisgreaves.com/Downloads/GUIundo.zip"&gt;http://www.chrisgreaves.com/Downloads/GUIundo.zip&lt;/a&gt;  is a link to a ZIPped file you can download, inspect and adapt.&lt;br /&gt;It represents a simple model for providing an Edit-Undo facility on GUI forms.&lt;br /&gt;&lt;br /&gt;In my real-world situation we had a GUI form with several interlocking options; changing &lt;span style="font-style:italic;"&gt;this&lt;/span&gt; and &lt;span style="font-style:italic;"&gt;that&lt;/span&gt; meant that &lt;span style="font-style:italic;"&gt;those&lt;/span&gt; were modified.&lt;br /&gt;&lt;br /&gt;I decided to permit the user to reverse successive decisions back to a valid restart point.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-6714147862125976134?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/6714147862125976134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=6714147862125976134' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/6714147862125976134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/6714147862125976134'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2007/09/edit-undo-for-gui-form.html' title='&quot;edit undo&quot; for a GUI form'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-5664005417050458741</id><published>2007-08-20T06:45:00.001-07:00</published><updated>2007-08-20T06:46:51.144-07:00</updated><title type='text'>New Releases</title><content type='html'>I have uploaded new versions of both UW.dot and UX.xla on the downloads page http://www.chrisgreaves.com/Downloads/&lt;br /&gt;&lt;br /&gt;As well, both zip files contain an upgraded version of my Setup.dot which now farms out XLS to your XLStart folder and XLA to your Addins folder. Neat!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-5664005417050458741?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/5664005417050458741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=5664005417050458741' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/5664005417050458741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/5664005417050458741'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2007/08/new-releases.html' title='New Releases'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-1362241149710863185</id><published>2007-01-23T03:13:00.000-08:00</published><updated>2007-01-23T03:14:51.548-08:00</updated><title type='text'>Frames</title><content type='html'>Word does not provide a frame-management facility. Frames were orphaned with the release of Word97. &lt;div class="Text2"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;Legacy documents and legacy habits continue to provoke problems with frames. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;These procedures attempt to reduce the frustration associated with frames.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;As a minimum, we wish that Word’s Edit-Replace dialogue provided an option to replace frames in the sense that we can replace section breaks and other non-text items.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;We will provide ability to locate and select the next frame, to clear all frames, to count the frames in a document.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;Replacement of a frame prompts us to ask what makes sense as a replacement?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;The procedures supplied allow the developer to:&lt;/span&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-size: 12pt;"&gt;Count frames within a range&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: 12pt;"&gt;Select the first frame in a range (GoTo)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: 12pt;"&gt;Select the last frame in a range (GoTo)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: 12pt;"&gt;Move forward one frame&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: 12pt;"&gt;Move backward one frame&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: 12pt;"&gt;Delete all frames within a range (except those frames that lie within tables).&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;These procedures could form the basis of a GUI form similar to Word's Edit, Replace.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div style="font-weight: bold;" class="MacroText"&gt;Public Function DeleteFrames(rng As Range)&lt;p&gt;Public Function lngCountFrames(rng As Range) As Long&lt;/p&gt;&lt;p&gt;Public Function SelectBackwardFrame(ByVal rng As Range)&lt;/p&gt;&lt;p&gt;Public Function SelectFirstFrame(rng As Range)&lt;/p&gt;&lt;p&gt;Public Function SelectForwardFrame(ByVal rng As Range)&lt;/p&gt;&lt;p&gt;Public Function SelectLastFrame(rng As Range)&lt;/p&gt;&lt;/div&gt;&lt;div class="Text2"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size: 12pt;"&gt;Here is a crude attempt to circumvent the frame/table problem:&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="MacroText"&gt;Public Function DeleteFrames(rng As Range)&lt;br /&gt;   Dim lng As Long&lt;br /&gt;   For lng = rng.Frames.Count To 1 Step -1&lt;br /&gt;       If rng.Frames(lng).Range.Information(wdWithInTable) Then&lt;br /&gt;'            MsgBox "I cannot delete frames within tables"&lt;br /&gt;           Selection.Rows.ConvertToText Separator:=wdSeparateByTabs, NestedTables:=True&lt;br /&gt;           rng.Frames(lng).Delete&lt;br /&gt;           Selection.ConvertToTable Separator:=wdSeparateByTabs, Format:=wdTableFormatNone&lt;br /&gt;       Else&lt;br /&gt;       rng.Frames(lng).Delete&lt;br /&gt;       End If&lt;br /&gt;   Next lng&lt;br /&gt;End Function&lt;br /&gt;Sub TESTDeleteFrames()&lt;br /&gt;   Call DeleteFrames(Selection.Range)&lt;br /&gt;End Sub&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-1362241149710863185?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/1362241149710863185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=1362241149710863185' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/1362241149710863185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/1362241149710863185'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2007/01/frames.html' title='Frames'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-4843003952864320596</id><published>2007-01-09T04:00:00.000-08:00</published><updated>2007-01-09T04:01:07.032-08:00</updated><title type='text'>New release</title><content type='html'>I have uploaded UW350.dot.&lt;br /&gt;You can download it from my downloads page at &lt;a href="http://www.chrisgreaves.com/Downloads/"&gt;http://www.chrisgreaves.com/Downloads/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-4843003952864320596?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/4843003952864320596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=4843003952864320596' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/4843003952864320596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/4843003952864320596'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2007/01/new-release.html' title='New release'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-116424286461251730</id><published>2006-11-22T16:46:00.000-08:00</published><updated>2006-11-22T16:47:44.643-08:00</updated><title type='text'>New release</title><content type='html'>I have uploaded UW345.dot.&lt;br /&gt;You can download it from my downloads page at &lt;a href="http://www.chrisgreaves.com/Downloads/"&gt;http://www.chrisgreaves.com/Downloads/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-116424286461251730?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/116424286461251730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=116424286461251730' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/116424286461251730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/116424286461251730'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2006/11/new-release_22.html' title='New release'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-116381818674592965</id><published>2006-11-17T18:48:00.000-08:00</published><updated>2006-11-17T18:49:46.756-08:00</updated><title type='text'>New release</title><content type='html'>I have uploaded UW345.dot.&lt;br /&gt;You can download it from my downloads page at &lt;a href="http://www.chrisgreaves.com/Downloads/"&gt;http://www.chrisgreaves.com/Downloads/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-116381818674592965?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/116381818674592965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=116381818674592965' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/116381818674592965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/116381818674592965'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2006/11/new-release.html' title='New release'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-116250148147827157</id><published>2006-11-02T13:02:00.000-08:00</published><updated>2006-11-02T13:04:41.490-08:00</updated><title type='text'>Sectioning an INI file</title><content type='html'>Nothing complex about it. (But see also &lt;a href="http://chris-greaves-utils.blogspot.com/2006/07/using-ini-file.html"&gt;Using An INI File&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;We want to store data that reflects our run-time in a file quite separate from the program. INI files have been around for a long time. They are text files, and a reasonably competent user can edit them. A reasonably competent designer (like you!) can build a GUI form for a user interface.&lt;br /&gt;&lt;br /&gt;Our application has two distinct phases the CORE and the RIM, and we would like to park INI keys and values in separate sections, one section to be called [CORE] and the other section to be called [RIM].&lt;br /&gt;&lt;br /&gt;In the sample code below I have used literal character strings; you will, of course, prefer to use string constants.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;References&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Set a reference to the utility library UW.DOT from within your project.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Constants&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In your constants module, declare two public constants:&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Public Const strcApplication As String = "MyTest"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Program code&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In a module write a very simple test macro:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Sub test()&lt;br /&gt;Dim strEnv As String&lt;br /&gt;strEnv = UW.strEnvironmentFactual(strcApplication)&lt;br /&gt;MsgBox UW.strprofilein(strEnv, "CORE", "1stKey", "1stValue")&lt;br /&gt;MsgBox UW.strprofilein(strEnv, "RIM", "1stKey", "2ndValue")&lt;br /&gt;End Sub&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Testing the code&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Run the little test macro.&lt;br /&gt;&lt;br /&gt;You will observe pop-up message boxes bearing the strings "1stValue" and "2ndValue".&lt;br /&gt;The INI file&lt;br /&gt;In your Documents and settings folder locate the file Utils.INI.&lt;br /&gt;&lt;br /&gt;Its contents should look like this:&lt;br /&gt;&lt;span style="font-style:italic;"&gt;[CORE]&lt;br /&gt;1stKey=1stValue&lt;br /&gt;[RIM]&lt;br /&gt;1stKey=2ndValue&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-116250148147827157?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/116250148147827157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=116250148147827157' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/116250148147827157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/116250148147827157'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2006/11/sectioning-ini-file.html' title='Sectioning an INI file'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-116134978980469614</id><published>2006-10-20T06:06:00.000-07:00</published><updated>2006-10-20T06:09:49.893-07:00</updated><title type='text'>Browsers</title><content type='html'>So called because they browse for files; or more correctly, they allow the end-user to browse for files and folders.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;strBrowseFile&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Return the Drive, Path, Name and Extent of a chosen file.&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;Sub TESTstrBrowseFile()&lt;br /&gt;MsgBox UW.Browsers.strBrowseFile&lt;br /&gt;End Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;StrBrowseFolder&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Return the Drive and Path of a chosen folder&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;Sub TESTstrBrowseFolder()&lt;br /&gt;MsgBox UW.Browsers.strBrowseFolder("Please choose a folder")&lt;br /&gt;End Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Return the Drive and Path of a chosen folder starting from a specific root folder.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Sub TESTstrBrowseFolderNewRoot()&lt;br /&gt;MsgBox UW.Browsers.strBrowseFolder("Please choose a folder", "c:\Greaves")&lt;br /&gt;End Sub&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-116134978980469614?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/116134978980469614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=116134978980469614' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/116134978980469614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/116134978980469614'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2006/10/browsers.html' title='Browsers'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-115824273505825201</id><published>2006-09-14T07:03:00.000-07:00</published><updated>2006-09-14T07:05:35.076-07:00</updated><title type='text'>DPNE</title><content type='html'>Short for &lt;span style="font-weight:bold;"&gt;D&lt;/span&gt;rive, &lt;span style="font-weight:bold;"&gt;P&lt;/span&gt;ath, &lt;span style="font-weight:bold;"&gt;N&lt;/span&gt;ame, &lt;span style="font-weight:bold;"&gt;E&lt;/span&gt;xtent.&lt;br /&gt;&lt;br /&gt;This module holds several low-level and high-level functions that parse a string reported to be that of a file name under Windows/DOS Operating systems.&lt;br /&gt;&lt;br /&gt;Here I will describe the high-level functions, the ones you are most likely to use. If you would like to know more about the low-level functions which return pointers to a parsed string, please contact me.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;strGetPath&lt;/span&gt;&lt;br /&gt;Given a string, Return the Path Item.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Sub TESTstrGetPath()&lt;br /&gt; MsgBox strGetPath("c:\autoexec.bat")&lt;br /&gt; MsgBox strGetPath("D:\Greaves\Admin\Web\Driving\BRAKING.DOC")&lt;br /&gt;End Sub&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;strGetNameExtent&lt;/span&gt;&lt;br /&gt;Given a string, return the name and extent portion&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;strGetName&lt;/span&gt;&lt;br /&gt;Given a string, return the name portion&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;strGetExtent&lt;/span&gt;&lt;br /&gt;Given a string, return the extent portion&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;strGetDrivePath&lt;/span&gt;&lt;br /&gt;Given a string, return the drive and path portions&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;strGetDrive&lt;/span&gt;&lt;br /&gt;Given a string, return the drive portions&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;strFixPath&lt;/span&gt;&lt;br /&gt;Ensure that the result has one and only one trailing, right-hand separator.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-115824273505825201?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/115824273505825201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=115824273505825201' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115824273505825201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115824273505825201'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2006/09/dpne.html' title='DPNE'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-115781423593737117</id><published>2006-09-09T08:03:00.000-07:00</published><updated>2006-09-09T08:03:55.970-07:00</updated><title type='text'>A Little Problem ….</title><content type='html'>A colleague attempted to download and install three applications form my download page (http://www.chrisgreaves.com/Downloads/) yesterday and ran into two sorts of problems. The first was a rogue virus-checker, but the second was caused by me.&lt;br /&gt;&lt;br /&gt;I use a batch file to PKZip25 the zip file for download. The batch file obtains the current production version of UW.DOT from my word startup folder.&lt;br /&gt;&lt;br /&gt;Where an application hasn't been updated for a long time, it will have a stale version of UW.DOT within the zip file, and I think some unzippers will timestamp this file with today's date as the file is unzipped and written to a folder. This version of UW.DOT now being "more recent" than any other version is now installed, and so a current application is running with a stale version of UW.DOT.&lt;br /&gt;&lt;br /&gt;My solution to this problem is tedious, but seems to work. When I release a new version of any application, I will re-zip each downloadable file with the latest UW.DOT.&lt;br /&gt;&lt;br /&gt;In consequence you will see the timestamp on the files seem awfully current, but at least every download will have a current copy of UW.DOT.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-115781423593737117?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/115781423593737117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=115781423593737117' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115781423593737117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115781423593737117'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2006/09/little-problem.html' title='A Little Problem ….'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-115729633253215479</id><published>2006-09-03T08:09:00.000-07:00</published><updated>2006-09-03T08:12:12.736-07:00</updated><title type='text'>DelayMe</title><content type='html'>This not a clever function. It will loop, consuming CPU time, until the specified time is elapsed. None the less is does provide a primitive one-time, short-time pause while your user contemplates the status of, say, a document thrown on the screen for a short interval.&lt;br /&gt;&lt;br /&gt;If you want to have the CPU carry on processing during your brief delay, you should use a function other than this.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Sub test()&lt;br /&gt;    Call UW.WD_Miscellaneous.DelayMe(6)&lt;br /&gt;    MsgBox "here"&lt;br /&gt;End Sub&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-115729633253215479?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/115729633253215479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=115729633253215479' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115729633253215479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115729633253215479'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2006/09/delayme.html' title='DelayMe'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-115693129841597995</id><published>2006-08-30T02:47:00.000-07:00</published><updated>2006-08-30T02:48:18.426-07:00</updated><title type='text'>Excel</title><content type='html'>The Excel utility library is available as an add-in file with an extension of XLA. Store the file in an appropriate folder, then from Excel choose Tools, Add-Ins, Browse, locate the file, make sure it is checked ON, confirm and use.&lt;br /&gt;&lt;br /&gt;How use?&lt;br /&gt;&lt;br /&gt;From an empty cell, start a formula with the "equals" sign, use the function-picker ("fx" button), Function category "User defined", and scroll to "strDateTime".&lt;br /&gt;&lt;br /&gt;Confirm out of there and observe he dynamic date and time, formatted as a 14-character string, in your cell. OK, Big deal, you have the Now() function in Excel.&lt;br /&gt;&lt;br /&gt;Try the strAlphaDigitsOnly function; point it to a cell containing a mixed bag of characters:&lt;br /&gt;&lt;br /&gt;Try obtaining your run-time parameters from an INI file:&lt;br /&gt;&lt;br /&gt;Knock, as we say, yourself our!&lt;br /&gt;&lt;br /&gt;You can now use Excel to test if a file is a Word Perfect DOS 5.1 file!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-115693129841597995?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/115693129841597995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=115693129841597995' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115693129841597995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115693129841597995'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2006/08/excel.html' title='Excel'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-115632970837607906</id><published>2006-08-23T03:39:00.000-07:00</published><updated>2006-08-23T03:41:48.386-07:00</updated><title type='text'>Two new releases</title><content type='html'>I have added links to my &lt;a href="http://www.chrisgreaves.com/Downloads/"&gt;Downloads page&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;You can now download the latest revision of the stand-alone files that contain my &lt;a href="http://www.chrisgreaves.com/downloads/UW.ZIP"&gt;Microsoft Word utility librar&lt;/a&gt;y and &lt;a href="http://www.chrisgreaves.com/downloads/UX.ZIP"&gt;Microsoft Excel utility library&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-115632970837607906?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/115632970837607906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=115632970837607906' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115632970837607906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115632970837607906'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2006/08/two-new-releases.html' title='Two new releases'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-115566327093750610</id><published>2006-08-15T10:33:00.000-07:00</published><updated>2006-08-15T10:35:05.313-07:00</updated><title type='text'>Constants</title><content type='html'>Good programming practices suggest the use of compile-time constants rather than literal strings.&lt;br /&gt;&lt;br /&gt;Instead of writing:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;strWorkFile = strWorkFile &amp; ".TXT"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;We write:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;strWorkFile = strWorkFile &amp; strcExtentTxt&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And include a declaration:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Public Const strcExtentTxt As String = ".TXT"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This may seem like extra work - replacing one line of code with two lines, but think again.&lt;br /&gt;&lt;br /&gt;By placing the character string in a constant and using the identifier for reference, we are assured of a common and consistent definition of the string, and have avoided the costly maintenance problem of a typo in one of perhaps twenty occurrences of the string throughout or program.&lt;br /&gt;&lt;br /&gt;As well, we can convert the compile-time constant to an installation or a run-time constant with a small modification, and will not be required to search through the program looking for occurrences of the literal string.&lt;br /&gt;&lt;br /&gt;You can draw on many years of established consistency by using the string constants defined in UW.DOT.&lt;br /&gt;&lt;br /&gt;Use Intellisense to draw out identifiers that are prefaced with "strc" (as in "str"ing "c"onstant)&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Sub test()&lt;br /&gt;MsgBox UW.strcAlpha&lt;br /&gt;MsgBox UW.strcAlphaDigits&lt;br /&gt;MsgBox UW.StrcDigits&lt;br /&gt;MsgBox UW.strcDriveSeparator&lt;br /&gt;End Sub&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-115566327093750610?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/115566327093750610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=115566327093750610' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115566327093750610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115566327093750610'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2006/08/constants.html' title='Constants'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-115409445954547553</id><published>2006-07-28T06:43:00.000-07:00</published><updated>2006-07-28T06:47:39.556-07:00</updated><title type='text'>ClipBoard</title><content type='html'>Five clipboard functions are provided. Two of them duplicate the action performed by the keyboard sequence PrtScr and Alt-PrtScr. Three of them deal with text data.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;ActiveScreenToClipboard&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Takes a snapshot of the current screen. Equivalent to tapping the PrtScr key.&lt;br /&gt;&lt;br /&gt;You can use this in reporting errors or the status of a running program.&lt;br /&gt;&lt;br /&gt;Once you have trapped the run-time error, issue a call to ActiveScreenToClipboard and at least have the user paste the results into Paintbrush. Better yet, use a routine to capture the clipboard image as a bitmap or other graphic file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Sub TESTActiveScreenToClipboard()&lt;br /&gt;Call ActiveScreenToClipboard&lt;br /&gt;End Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;ActiveWindowToClipboard&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Takes a snapshot of the current window. Equivalent to tapping the Alt-PrtScr key combination.&lt;br /&gt;&lt;br /&gt;You can use this in reporting errors or the status of a running program.&lt;br /&gt;&lt;br /&gt;Once you have trapped the run-time error, issue a call to ActiveWindowToClipboard and at least have the user paste the results into Paintbrush. Better yet, use a routine to capture the clipboard image as a bitmap or other graphic file.&lt;br /&gt;&lt;br /&gt;I have had little success with this function, the equivalent of Alt-PrtScr, under Windows XP&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Sub TESTActiveWindowToClipboard()&lt;br /&gt;Call ActiveWindowToClipboard&lt;br /&gt;End Sub&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;ClearClipboard&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returns any text stored in the clipboard before emptying the clipboard.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Sub TESTstrClearClipboard()&lt;br /&gt;MsgBox strClearClipboard&lt;br /&gt;End Sub&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;StrAppendToClipboard&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returns any text stored in the clipboard before appending the supplied string to the clipboard.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Sub TESTstrAppendToClipboard()&lt;br /&gt;MsgBox strAppendToClipboard("v")&lt;br /&gt;MsgBox strAppendToClipboard("w")&lt;br /&gt;MsgBox strAppendToClipboard("x")&lt;br /&gt;MsgBox strClearClipboard&lt;br /&gt;MsgBox strAppendToClipboard("y")&lt;br /&gt;MsgBox strAppendToClipboard("z")&lt;br /&gt;End Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;strLoadToClipboard&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returns any text stored in the clipboard before loading the supplied string to the clipboard.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Sub TESTstrLoadToClipboard()&lt;br /&gt;MsgBox strLoadToClipboard("b")&lt;br /&gt;MsgBox strLoadToClipboard("c")&lt;br /&gt;MsgBox strLoadToClipboard("d")&lt;br /&gt;End Sub&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-115409445954547553?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/115409445954547553/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=115409445954547553' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115409445954547553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115409445954547553'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2006/07/clipboard.html' title='ClipBoard'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-115369623109601100</id><published>2006-07-23T16:09:00.000-07:00</published><updated>2006-07-27T12:58:20.073-07:00</updated><title type='text'>Fun 4 X</title><content type='html'>Also known as “Fun For All”.&lt;br /&gt;&lt;br /&gt;I had reason to demonstrate my ability to switch languages (English, French, Spanish etc.) on the Control Tip Text on controls on a GUI form.&lt;br /&gt;&lt;br /&gt;I decided to demonstrate by changing the established English-language tips to whimsical bumper stickers.&lt;br /&gt;&lt;br /&gt;At the same time I was lecturing to classes in a sunny room, and students couldn’t see the GUI forms.&lt;br /&gt;&lt;br /&gt;I decided to introduce random colour schemes.&lt;br /&gt;&lt;br /&gt;Then I got carried away and decided that the fonts and mouse pointers could do with a touch-up.&lt;br /&gt;&lt;br /&gt;The result is Fun4X.&lt;br /&gt;&lt;br /&gt;To see how it works, introduce a new User Form and place four command controls on the form.&lt;br /&gt;&lt;br /&gt;I haven’t bothered to rename or captioon them, for reasons which will appear below.&lt;br /&gt;&lt;br /&gt;Set a refernce to UW.DOT.&lt;br /&gt;&lt;br /&gt;Double-click on a command button and write the code for that button, close, double-click on the next, write, close and so on until all 4 command buttons have code and then write the userform initialization code, as set out below.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Private Sub CommandButton1_Click()&lt;br /&gt;    Call UW.cmdColoursClick(Me)&lt;br /&gt;End Sub&lt;br /&gt;Private Sub CommandButton2_Click()&lt;br /&gt;    Call UW.cmdFontsClick(Me)&lt;br /&gt;End Sub&lt;br /&gt;Private Sub CommandButton3_Click()&lt;br /&gt;    Call UW.cmdIconsClick(Me)&lt;br /&gt;End Sub&lt;br /&gt;Private Sub CommandButton4_Click()&lt;br /&gt;    Call UW.cmdCaptionsClick(Me)&lt;br /&gt;End Sub&lt;br /&gt;Private Sub UserForm_Initialize()&lt;br /&gt;    Call UW.UserFormInitialize(Me)&lt;br /&gt;End Sub&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Run the user form (F5 function key), and you’ll see this:&lt;br /&gt;&lt;br /&gt;I had hooked the top-left control to “Colours”, and the bottom left control to “Captions”.&lt;br /&gt;&lt;br /&gt;Click the Colours control repeatedly and watch the pretty random colours.&lt;br /&gt;&lt;br /&gt;Click the Captions control once, then inspect your Control Tip Text.&lt;br /&gt;&lt;br /&gt;If you have icon files (*.ICO) on your root drive C:, you can switch mouse pointers.&lt;br /&gt;&lt;br /&gt;You can change font face and size, too.&lt;br /&gt;&lt;br /&gt;Once I am sure the controls are working, I resize them to be 4-pixel square “rivets” in each corner of the GUI form.&lt;br /&gt;&lt;br /&gt;That’s why I don’t need captions!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-115369623109601100?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/115369623109601100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=115369623109601100' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115369623109601100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115369623109601100'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2006/07/fun-4-x.html' title='Fun 4 X'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-115287774494657668</id><published>2006-07-14T04:46:00.000-07:00</published><updated>2006-07-14T04:49:04.963-07:00</updated><title type='text'>Using an INI file</title><content type='html'>Nothing complex about it.&lt;br /&gt;&lt;br /&gt;We want to store data that reflects our run-time in a file quite separate from the program. INI files have been around for a long time. They are text files, and a reasonably competent user can edit them. A reasonably competent designer (like you!) can build a GUI form for a user interface.&lt;br /&gt;&lt;br /&gt;Let us start by writing a small chunk of application code to demonstrate using an INI file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;References&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Set a reference to the utility library UW.DOT from within your project.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Constants&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In your constants module, declare two public constants:&lt;br /&gt;&lt;br /&gt;Public Const strcDriveLetter As String = "DriveLetter"&lt;br /&gt;Public Const strcDriveLetterDefault As String = "C"&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Program code&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In a module write a very simple test macro:&lt;br /&gt;&lt;br /&gt;Sub test()&lt;br /&gt;MsgBox UW.UT_ProfileStrings.strGPA(Publics.strcDriveLetter, Publics.strcDriveLetterDefault)&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;You can, of course, omit the explicit module names:&lt;br /&gt;&lt;br /&gt;Sub test()&lt;br /&gt;MsgBox strGPA(strcDriveLetter, strcDriveLetterDefault)&lt;br /&gt;End Sub&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Testing the code&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Run the little test macro.&lt;br /&gt;&lt;br /&gt;You will observe a pop-up message box bearing the letter "C".&lt;br /&gt;The INI file&lt;br /&gt;&lt;br /&gt;In your Documents and settings folder locate the file Utils.INI.&lt;br /&gt;&lt;br /&gt;Its contents should look like this:&lt;br /&gt;[Utils]&lt;br /&gt;DriveLetter=C&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Changing the INI file&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;While you have the INI file open in Notepad, change the drive letter to be "D".&lt;br /&gt;&lt;br /&gt;Re run the little test macro and observe the pop-up message box bearing the letter "D"&lt;br /&gt;How it works&lt;br /&gt;&lt;br /&gt;The procedure strGPA looks for a suitable INI file. If it doesn't find one, it builds one!&lt;br /&gt;&lt;br /&gt;Within that file it looks for a key as stated in the first parameter of the call to strGPA; in our case the first parameter is "strcDriveLetter", so strGPA looks for a key "DriveLetter".&lt;br /&gt;&lt;br /&gt;If the given parameter can not be found, strGPA creates a key and value using the second parameter of the call.; in our case the second parameter was "strcDriveLetterDefault" so the value defaults to "C", and that value is written to the INI file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;What is so good about all this?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I am glad you asked.&lt;br /&gt;&lt;br /&gt;First off, you don't need to worry about the INI file. Just define your key names and default values, and strGPA does the rest.&lt;br /&gt;&lt;br /&gt;Next, your user interface can include a Âpanic" button; resetting an INI file to default values is as simple as deleting the INI file. Your panic button merely KILLs the INI file, and each subsequent call will store and return the default values.&lt;br /&gt;&lt;br /&gt;There's more Â a strPPA function for Putting parameters to an INI file, section management, and the use of value strings much longer than the Microsoft limit of 255 characters.&lt;br /&gt;&lt;br /&gt;As well the source code is switchable between registry, regular INI and long-value INI file methods.&lt;br /&gt;&lt;br /&gt;More later&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-115287774494657668?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/115287774494657668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=115287774494657668' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115287774494657668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115287774494657668'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2006/07/using-ini-file.html' title='Using an INI file'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-115124835070745249</id><published>2006-06-25T08:01:00.000-07:00</published><updated>2006-07-02T18:44:38.986-07:00</updated><title type='text'>Logging events</title><content type='html'>Many of my applications involve processing huge (20,000+) numbers of document or template files.&lt;br /&gt;&lt;br /&gt;Often some of these documents will baulk the process - especially documents with forms, ASK fields, or templates with stale references. For these applications I maintin an Exclusion file - a list of files I ought not to process; more on that in the next post.&lt;br /&gt;&lt;br /&gt;For now I'll explain one method of dealing with awkward files.&lt;br /&gt;&lt;br /&gt;I maintain a log file of events:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;    If os.strLogFile = strcTrue Then&lt;br /&gt;        Call Logger("ProcessProjectsOfFolder with " &amp; strProjectList)&lt;br /&gt;    Else&lt;br /&gt;    End If&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The slave function Logger obtains a valid name that will point into my Documents And settings folder:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Public Function Logger(strMsg As String)&lt;br /&gt;    Dim strLogFile As String&lt;br /&gt;    strLogFile = UW.STRFIXPATH(UW.strEnvironmentFactual(strcApplication))&lt;br /&gt;    strLogFile = strLogFile &amp; "LogFile.txt"&lt;br /&gt;    Call logfile(strLogFile, strMsg)&lt;br /&gt;End Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The slave function LogFile prints to a file:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Public Function LogFile(strFile As String, strMsg As String)&lt;br /&gt;    ' Procedure :   LogFile&lt;br /&gt;    ' Description:  Time stamp a message string to a file.&lt;br /&gt;    ' Copyright:    Christopher Greaves&lt;br /&gt;    ' Inputs:       The local or full file name, a string.&lt;br /&gt;    ' Returns:      None.&lt;br /&gt;    ' Assumes:      None.&lt;br /&gt;    ' Side Effects: None.&lt;br /&gt;    ' Tested:       By the calls shown below.&lt;br /&gt;    Call PrintFile(strFile, strDateTime &amp; vbTab &amp; strMsg)&lt;br /&gt;    'Sub TESTLogFile()&lt;br /&gt;    '    Call LogFile("erase.txt", "Here is a first message") ' stored in macroContainer folder&lt;br /&gt;    '    Call LogFile("c:\erase.txt", "Here is a second message") ' stored in boot root folder&lt;br /&gt;    '    Call LogFile(MacroContainer.Path &amp; Application.PathSeparator &amp; "erase.txt", "Here is a third message")&lt;br /&gt;    'End Sub&lt;br /&gt;End Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;While printFile merely opens, appends and closes a text file:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Public Function PrintFile(strFile As String, strMsg As String)&lt;br /&gt;    ' Procedure :   PrintFile&lt;br /&gt;    ' Description:  Print a message to a file.&lt;br /&gt;    ' Copyright:    Christopher Greaves&lt;br /&gt;    ' Inputs:       The local or full file name, a string.&lt;br /&gt;    ' Returns:      None.&lt;br /&gt;    ' Assumes:      None.&lt;br /&gt;    ' Side Effects: None.&lt;br /&gt;    ' Tested:       By the calls shown below.&lt;br /&gt;    Dim intFile As Integer&lt;br /&gt;    intFile = FreeFile&lt;br /&gt;    Dim strWorkFile As String&lt;br /&gt;    strWorkFile = strFile&lt;br /&gt;    ' add an extent if there is not one yet.&lt;br /&gt;    If InStr(1, strFile, strcExtentSeparatorDefaultValue) &gt; 0 Then&lt;br /&gt;    Else&lt;br /&gt;        strWorkFile = strWorkFile &amp; strcExtentTxt&lt;br /&gt;    End If&lt;br /&gt;    ' add a path if there is not one yet.&lt;br /&gt;    If InStr(1, strFile, Application.PathSeparator) &gt; 0 Then&lt;br /&gt;    Else&lt;br /&gt;        strWorkFile = strMacroContainerPathValue &amp; strWorkFile&lt;br /&gt;    End If&lt;br /&gt;    Open strWorkFile For Append As #intFile&lt;br /&gt;    Print #intFile, strMsg&lt;br /&gt;    Close #intFile&lt;br /&gt;End Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;That's an awful lot of code to say "I've started!", but note that PrintFile, and hence Logger, will have closed the file before the next statement is executed, so that no matter how the application crashes, I'll have a record of the file that triggered the failure, and can deal with it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-115124835070745249?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/115124835070745249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=115124835070745249' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115124835070745249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115124835070745249'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2006/06/logging-events.html' title='Logging events'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-115021704231544751</id><published>2006-06-13T09:40:00.000-07:00</published><updated>2006-06-13T09:44:02.403-07:00</updated><title type='text'>Parsing Strings</title><content type='html'>Available  in my &lt;a href="http://www.chrisgreaves.com/downloads/Uw.zip"&gt;UW.DOT&lt;/a&gt; and &lt;a href="http://www.chrisgreaves.com/downloads/Ux.zip"&gt;UX.XLS&lt;/a&gt; libraries.&lt;br /&gt;Nothing complex about it. We are often asked to split or parse strings into sub-strings.&lt;br /&gt;Typically we receive a series of words separated by spaces or the comma character; sometimes separated by the tab character (vbTab in VBA)&lt;br /&gt;We can peel off consecutive substrings in this manner:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Sub ParseStrings()&lt;br /&gt;    Dim strMyString As String&lt;br /&gt;    strMyString = "Nothing complex about it."&lt;br /&gt;    While Len(strMyString) &gt; 0&lt;br /&gt;        MsgBox UW.strSplitAt(strMyString, " ")&lt;br /&gt;    Wend&lt;br /&gt;End Sub&lt;br /&gt;&lt;/span&gt;Of course, we need to know in advance what character to use as a delimiter.&lt;br /&gt;Smart programming suggests that we adopt a convention of building a string of substrings by placing the delimiter as the first or left-most character:&lt;br /&gt;strMyString = " Nothing complex about it."&lt;br /&gt;Now we can write a parsing routine that is independent of the delimiter:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Sub ParseStrings()&lt;br /&gt;    Dim strMyString As String&lt;br /&gt;    strMyString = " Nothing complex about it."&lt;br /&gt;    Dim strDelimiter As String&lt;br /&gt;    strDelimiter = Left$(strMyString, 1)&lt;br /&gt;    While Len(strMyString) &gt; 0&lt;br /&gt;        MsgBox UW.strSplitAt(strMyString, strDelimiter)&lt;br /&gt;    Wend&lt;br /&gt;End Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Read more at &lt;a href="http://www.chrisgreaves.com/BlogUtils/ParsingStrings.html"&gt;http://www.chrisgreaves.com/BlogUtils/ParsingStrings.html&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-115021704231544751?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/115021704231544751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=115021704231544751' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115021704231544751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/115021704231544751'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2006/06/parsing-strings.html' title='Parsing Strings'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-114865136095634969</id><published>2006-05-26T06:46:00.000-07:00</published><updated>2006-06-13T09:45:11.286-07:00</updated><title type='text'>Network Paths</title><content type='html'>Available&lt;span style=""&gt;  &lt;/span&gt;in my &lt;a href="http://www.chrisgreaves.com/downloads/Uw.zip"&gt;UW.DOT&lt;/a&gt; and &lt;a href="http://www.chrisgreaves.com/downloads/Ux.zip"&gt;UX.XLS&lt;/a&gt; libraries.  &lt;p class="Text2"&gt;In developing an archiving tool, I find a need to manipulate paths. Specifically I want to “spray” several copies of each file to a set of locations, like this:&lt;/p&gt;   &lt;p class="Text3"&gt;&lt;span style=""&gt;  &lt;/span&gt;MsgBox strArchiveToSites("b:\ShellLnk\Module1.bas", _&lt;br /&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style=""&gt;   &lt;/span&gt;",b:\archive,\\BBB\Boot80GB (C),\\BBB\A,\\BBB\d", 0)&lt;/p&gt;   &lt;p class="Text2"&gt;“BBB” is my Big beige Box (as distinct from LapTop).&lt;br /&gt;Drive C is my R&amp;D drive.&lt;br /&gt;Drive D is the removable 400 GB backup drive on rails.&lt;br /&gt;Drive A is the floppy disk on the BBB; I’m testing, OK? (grin!)&lt;/p&gt;   &lt;p class="Text2"&gt;The procedure &lt;span class="MacroCharacters"&gt;&lt;span style=""&gt;strArchiveToSites&lt;/span&gt;&lt;/span&gt; is to copy the &lt;span class="MacroCharacters"&gt;&lt;span style=""&gt;Module1.BAS&lt;/span&gt;&lt;/span&gt; file to each of those areas, and so it may need to create folders (&lt;span class="MacroCharacters"&gt;&lt;span style=""&gt;MkDir&lt;/span&gt;&lt;/span&gt;) on networked drives. VBA can’t cope with this, so I need to assign a drive letter temporarily while I do my stuff.&lt;/p&gt;   &lt;p class="Text2"&gt;Because I’ll be issuing the “copy” command repeatedly for the same set of network paths, it makes sense to map each network path to a unique drive letter, copy all the files using the drive letter assignments, and then disconnect the drive letters.&lt;/p&gt;   &lt;p class="Text2"&gt;In the example below I’ve shown how I obtain a drive letter for a single path, do My Stuff, and then disconnect.&lt;/p&gt;   &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Sub TESTstrPathToDriveMap()&lt;br /&gt;    Dim strTempDriveLetter As String&lt;br /&gt;    strTempDriveLetter = strPathToDriveMap("\\Bigbeigebox\Boot80GB (C)", "")&lt;br /&gt;    ''' do stuff below here&lt;br /&gt;    MkDir strTempDriveLetter &amp; "\" &amp; Format(Time(), "hhmmss")&lt;br /&gt;    ''' do stuff above here&lt;br /&gt;    strTempDriveLetter = strPathToDriveUnMap(strTempDriveLetter)&lt;br /&gt;End Sub&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;p class="Text2"&gt;In the real world, the pseudo-code would look like this:&lt;/p&gt;   &lt;p class="MsoMacroText"&gt;Get drive letters for each networked path&lt;br /&gt;For each file to be processed&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;Call the strArchiveToSites procedure using the mapped drives.&lt;br /&gt;Release the mapped drive letters.&lt;/p&gt;   &lt;p class="Text2"&gt;To see how these two functions work for you, paste the macro &lt;span class="MacroCharacters"&gt;&lt;span style=""&gt;TESTstrPathToDriveMap&lt;/span&gt;&lt;/span&gt; into a module, change the literal network path, run the macro, and check that a new folder has been created on your network drive.&lt;br /&gt;&lt;/p&gt; &lt;p class="Text2"&gt;(Read more at &lt;a href="http://www.chrisgreaves.com/utils/NetworkPaths.html"&gt;http://www.chrisgreaves.com/utils/NetworkPaths.html&lt;/a&gt;)&lt;br /&gt;&lt;/p&gt; &lt;p class="Text2"&gt;Available&lt;span style=""&gt;  &lt;/span&gt;in my &lt;a href="http://www.chrisgreaves.com/downloads/Uw.zip"&gt;UW.DOT&lt;/a&gt; and &lt;a href="http://www.chrisgreaves.com/downloads/Ux.zip"&gt;UX.XLS&lt;/a&gt; libraries.&lt;br /&gt;&lt;/p&gt; &lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-114865136095634969?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/114865136095634969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=114865136095634969' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/114865136095634969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/114865136095634969'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2006/05/network-paths.html' title='Network Paths'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28738321.post-114857875133342350</id><published>2006-05-25T10:37:00.000-07:00</published><updated>2006-05-25T10:39:56.280-07:00</updated><title type='text'>About This Blog</title><content type='html'>&lt;p class="Text2"&gt;I develop applications, primarily in Visual Basic for Applications (VBA), and primarily using Microsoft Word as a vehicle, but extending to Excel-VBA, PowerPoint-VBA and Access-VBA.&lt;/p&gt;   &lt;p class="Text2"&gt;My background in application development has taught me to use libraries of utility procedures to speed up my development.&lt;/p&gt;   &lt;p class="Text2"&gt;This blog documents the new and the more commonly-used existing functions that can be found in my &lt;a href="http://www.chrisgreaves.com/downloads/Uw.zip"&gt;UW.DOT&lt;/a&gt; and &lt;a href="http://www.chrisgreaves.com/downloads/Ux.zip"&gt;UX.XLS&lt;/a&gt; libraries.&lt;/p&gt;   &lt;p class="Text2"&gt;You can download the most current copy of those files by clicking on the links.&lt;/p&gt;   &lt;p class="Text2"&gt;In some examples you will see a small subroutine “TEST”, commented out. I usually drag this commented test out of the procedure body and de-comment it as a built-in self-testing procedure.&lt;br /&gt;&lt;/p&gt; &lt;p class="Text2"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;[ &lt;a href="http://www.chrisgreaves.com/"&gt;&lt;span style=""&gt;Home&lt;/span&gt;&lt;/a&gt; ] [ &lt;a href="http://www.chrisgreaves.com/contact.html"&gt;&lt;span style=""&gt;Contact Me&lt;/span&gt;&lt;/a&gt; ]&lt;/span&gt;&lt;/p&gt;   &lt;span style=""&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28738321-114857875133342350?l=chris-greaves-utils.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chris-greaves-utils.blogspot.com/feeds/114857875133342350/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28738321&amp;postID=114857875133342350' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/114857875133342350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28738321/posts/default/114857875133342350'/><link rel='alternate' type='text/html' href='http://chris-greaves-utils.blogspot.com/2006/05/about-this-blog.html' title='About This Blog'/><author><name>Under The Hood</name><uri>http://www.blogger.com/profile/17001191718502429626</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://3.bp.blogspot.com/_4XfhhMAVI6c/Svs3Bry75eI/AAAAAAAAAIk/-CAuc0r2j94/s1600-R/Chris_GEDC1894_Head%2520(Small)_LR.JPG'/></author><thr:total>0</thr:total></entry></feed>
