HP3000-L Archives

June 2001, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
John Pollard <[log in to unmask]>
Reply To:
John Pollard <[log in to unmask]>
Date:
Wed, 20 Jun 2001 12:29:44 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (52 lines)
Someone asked that I share what I did - I would have done so earlier, but
was not certain just where to begin and end.  Apologies if I choose the
wrong begin/end points.

I have a very computer illerate user that will be uploading files from a PC
to the HP on a regular basis. I knew that in 99% of cases, the file to be
uploaded would be the newest file in a known directory; so I wanted to be
able to present that filename to the user as the "default" file to upload;
but to give the user the ability to "browse" to override that name.  I
wrote a Reflection routine to get the name of the newest file (I can supply
that if anyone is interested), but I wanted a way to present that name to
the user when he was making his selection.

The method Joe submitted will do the trick, but it does force the user to
work with the default file name in one "dialog" box; then, if the user
decides not to use the default name, they will be taken to a second dialog
box (the GetOpenFilename dialog).  What I wanted was a dialog like
GetOpenFilename but with the default name appearing in the field where the
selected file name should appear - in other words, a "one-box" solution.

I am not sure why the GetOpenFilename method does not allow a default file
name to be supplied, but the GetSaveAsFilename method does.  Here is the
meat of the "upload" script.  (I made a separate script to get the name of
the newest file: "getfname-by-date" and it gets passed the name of the
directory to search. It returns the name of the file it finds in
the "clipboard".)


Dim  BoxFile      as String
Dim  FBoxTitle    as String
Dim  ButtonText   as String
Dim  DefaultFile  as String
Dim  PCDir        as String

With Application
PCDir       = "C:\DOWNLOAD\EDI"
.RunScript  "getfname-by-date", PCDir
DefaultFile =.GetClipBoardText
BoxTitle    ="Chose File Name to Upload"
ButtonText  ="Finished"
Boxfile     =.GetSaveAsFilename(DefaultFile,,,BoxTitle,ButtonText)
End With


And in my actual script, but not shown here, I put the GetSaveAsFilename in
a WHILE loop which tests for things like a blank file name, etc.)

HTH

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2