Jason:  Since the RBase while loop was so easy to write, I'm not sure I 
want to bother having a VB script involved, but thanks for the lesson!

In the meantime did you notice Bernie's suggestion?   It didn't work for my 
immediate need because the file needed to be launched automatically, but 
for the next file type I had to do, the client wanted me to bring up a list of 
files even if there was only one because he wanted the user to carefully 
look at the filename before opening it.  Of course I gave him the LoadFilename 
plugin, and he didn't like it for this application because he didn't want 
the directory path to be exposed to the user.   Before I had time to think of 
an alternate, Bernie suggests the #LFiles!   I have to embed the part# 
(which can have spaces) in the file, so here's how I did it:

SET VAR vDirectory TEXT = "F:\Document\Forms\Inspection Plans\"
SET VAR vFNamePart  = ( CVAL("QUOTES") + .vDirectory + .v_custpart + 
"-*insp*.xls" + CVAL("QUOTES") )

SET VAR vFilename TEXT = NULL
SET VAR vCommand = ("CHOOSE vFilename FROM #LFILES IN" & .vFNamePart)
&vCommand

IF xError <> 0 THEN
  PAUSE 2 USING "No IP file for this part" CAPTION "No file" OPTION 
MESSAGE_FONT_SIZE 11
  RETURN
ENDIF
IF vFilename = "[ESC]" THEN
  RETURN
ENDIF

SET VAR vFilename = (.vDirectory + .vFilename)
LAUNCH .vFilename


Karen




 
> Karen,
>     If you are sure that there will only be one file per part number, and 
> if the part numbers are unique, then the first bit of VB code below will 
> search for a file beginning with <PARTNO> and put it into a file.

Reply via email to