writing a script to go through a collection of MS Project files in a
folder and muck around with them in Project.

Need to be able to have the user specify which file is the shared
resource pool file...preferably through a dialog box rather than
manually typing in the path/file name.

Problem is that some of the users have Win2K and the others have XP.
Which means that I can't exclusively use the XP specific common dialog
way of doing business.

I've tried plowing through the various script pages on MSDN and Technet
to no avail for how to do a "select a file" dialog box on a Win2K
system.

Any advice/suggestions would be very helpful.

Re: Newbie Common Dialog question by Joe

Joe
Fri Jun 24 14:23:20 CDT 2005

Hi,

[bottom post]

"jsl" <jennifer.lyon@ngc.com> wrote in message
news:1119633295.700736.286360@g47g2000cwa.googlegroups.com...
> writing a script to go through a collection of MS Project files in a
> folder and muck around with them in Project.
>
> Need to be able to have the user specify which file is the shared
> resource pool file...preferably through a dialog box rather than
> manually typing in the path/file name.
>
> Problem is that some of the users have Win2K and the others have XP.
> Which means that I can't exclusively use the XP specific common dialog
> way of doing business.
>
> I've tried plowing through the various script pages on MSDN and Technet
> to no avail for how to do a "select a file" dialog box on a Win2K
> system.
>
> Any advice/suggestions would be very helpful.
>

The generic MsComDlg object is available on all Windows installations, but
requires a license to activate it, which is usually obtained installation of
VB, Sudio or a similar product.

If your network is not so large that it is a problem to install the license
on each machine where you'll use it, there are two free MS downloads that
install the MsComDlg license.

VB5CCE, is still available as freeware from MS (at least it was as of a few
of weeks ago), even though it has been removed from the MS Download Center
listing. It's a very useful program for wrapping your own occasional COM,
but it's a very large download and installation, if all you're after is the
license.

VB5CCE
http://download.microsoft.com/msdownload/sbn/vbcce/vb5ccein.exe

VB5CCE Documentation
http://download.microsoft.com/download/5/2/5/5253a7ea-1310-40d8-b762-625c2019310e/ccehelp.exe


Paul Randall pointed out a couple of weeks ago that the MS HTMLEditor sample
HTA also installs the license. It's a lightweight download with no
installation and can be easily deleted after the license is installed. The
first time that you run it, it will prompt you to install the license, if
it's not already installed on your computer.

http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/samples/internet/author/html/htmleditor/default.asp


Also -- the OCX and INF files in a CAB file, unnecessary if you install
through one of the above.

http://activex.microsoft.com/controls/vb5/comdlg32.cab


Syntax --

MSDN, CommonDialog Control
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cmdlg98/html/vbobjCommonDialog.asp?frame=true

MSDN, Flags Property (Open, Save As Dialogs)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cmdlg98/html/vbproflagsfile.asp


If you don't want to go this route, there are two other possibilities.

(1) If your Win2k installations were initially pre-SP4 and your WinXp
installations were pre-SP1a (SP1 or before), you have the MS Java VM
installed. Script can access the common dialog component of the VM.
Updates do not remove the VM, but this solution is not available for newer
installations, per the resolution of the MS-Sun litigation. Credit
Alessandro Angeli for this method.

If you want to pursue this possibility, post back.

(2) You can use the IE object's Choose File popup from the Input-File
element as a file selection dialog. Literally dozens of versions of this
option have been posted on the scripting NGs and various websites. I
believe that original credit for this method goes to Walter Zachary and Tom
Lavedas.

http://groups-beta.google.com/group/microsoft.public.scripting.wsh/browse_frm/thread/f3061f3bc2da31f5/d95fd80c38520bd7?q=earnest+file+input+group:microsoft.public.scripting.*&rnum=1&hl=en#d95fd80c38520bd7

As a final alternative, you can install a custom ActiveX to do this. There
are several around.

http://www.jsware.net/jsware/boss.html

Joe Earnest





Re: Newbie Common Dialog question by mr_unreliable

mr_unreliable
Fri Jun 24 16:13:40 CDT 2005

hi jsi,

There are other ways to use the open file dialog, other than using
Microsoft's ComDlg32.ocx.

Search the newsgroup archives, looking for open file dialog.

If you don't like using any of those techniques, then there are
countless other (free) third-party controls that will show an
open file dialog, -- that is if you don't mind distributing them.

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)




jsl wrote:
> writing a script to go through a collection of MS Project files in a
> folder and muck around with them in Project.
>
> Need to be able to have the user specify which file is the shared
> resource pool file...preferably through a dialog box rather than
> manually typing in the path/file name.
>
> Problem is that some of the users have Win2K and the others have XP.
> Which means that I can't exclusively use the XP specific common dialog
> way of doing business.
>
> I've tried plowing through the various script pages on MSDN and Technet
> to no avail for how to do a "select a file" dialog box on a Win2K
> system.
>
> Any advice/suggestions would be very helpful.
>

Re: Newbie Common Dialog question by mayayana

mayayana
Fri Jun 24 19:04:54 CDT 2005

I vote that Joe Earnest be elected to write the
exhaustive answer to that question and post it
on the web somewhere, so that we can just
answer the next post with "read this link". :)

--
--
Joe Earnest <jearnest3-SPAM@earthlink.net> wrote in message
news:eBBTwIPeFHA.412@tk2msftngp13.phx.gbl...
> Hi,
>
> [bottom post]
>
> "jsl" <jennifer.lyon@ngc.com> wrote in message
> news:1119633295.700736.286360@g47g2000cwa.googlegroups.com...
> > writing a script to go through a collection of MS Project files in a
> > folder and muck around with them in Project.
> >
> > Need to be able to have the user specify which file is the shared
> > resource pool file...preferably through a dialog box rather than
> > manually typing in the path/file name.
> >
> > Problem is that some of the users have Win2K and the others have XP.
> > Which means that I can't exclusively use the XP specific common dialog
> > way of doing business.
> >
> > I've tried plowing through the various script pages on MSDN and Technet
> > to no avail for how to do a "select a file" dialog box on a Win2K
> > system.
> >
> > Any advice/suggestions would be very helpful.
> >
>
> The generic MsComDlg object is available on all Windows installations, but
> requires a license to activate it, which is usually obtained installation
of
> VB, Sudio or a similar product.
>
> If your network is not so large that it is a problem to install the
license
> on each machine where you'll use it, there are two free MS downloads that
> install the MsComDlg license.
>
> VB5CCE, is still available as freeware from MS (at least it was as of a
few
> of weeks ago), even though it has been removed from the MS Download Center
> listing. It's a very useful program for wrapping your own occasional COM,
> but it's a very large download and installation, if all you're after is
the
> license.
>
> VB5CCE
> http://download.microsoft.com/msdownload/sbn/vbcce/vb5ccein.exe
>
> VB5CCE Documentation
>
http://download.microsoft.com/download/5/2/5/5253a7ea-1310-40d8-b762-625c201
9310e/ccehelp.exe
>
>
> Paul Randall pointed out a couple of weeks ago that the MS HTMLEditor
sample
> HTA also installs the license. It's a lightweight download with no
> installation and can be easily deleted after the license is installed.
The
> first time that you run it, it will prompt you to install the license, if
> it's not already installed on your computer.
>
>
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/samples/int
ernet/author/html/htmleditor/default.asp
>
>
> Also -- the OCX and INF files in a CAB file, unnecessary if you install
> through one of the above.
>
> http://activex.microsoft.com/controls/vb5/comdlg32.cab
>
>
> Syntax --
>
> MSDN, CommonDialog Control
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cmdlg98/htm
l/vbobjCommonDialog.asp?frame=true
>
> MSDN, Flags Property (Open, Save As Dialogs)
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cmdlg98/htm
l/vbproflagsfile.asp
>
>
> If you don't want to go this route, there are two other possibilities.
>
> (1) If your Win2k installations were initially pre-SP4 and your WinXp
> installations were pre-SP1a (SP1 or before), you have the MS Java VM
> installed. Script can access the common dialog component of the VM.
> Updates do not remove the VM, but this solution is not available for newer
> installations, per the resolution of the MS-Sun litigation. Credit
> Alessandro Angeli for this method.
>
> If you want to pursue this possibility, post back.
>
> (2) You can use the IE object's Choose File popup from the Input-File
> element as a file selection dialog. Literally dozens of versions of this
> option have been posted on the scripting NGs and various websites. I
> believe that original credit for this method goes to Walter Zachary and
Tom
> Lavedas.
>
>
http://groups-beta.google.com/group/microsoft.public.scripting.wsh/browse_fr
m/thread/f3061f3bc2da31f5/d95fd80c38520bd7?q=earnest+file+input+group:micros
oft.public.scripting.*&rnum=1&hl=en#d95fd80c38520bd7
>
> As a final alternative, you can install a custom ActiveX to do this.
There
> are several around.
>
> http://www.jsware.net/jsware/boss.html
>
> Joe Earnest
>
>
>
>



Re: Newbie Common Dialog question by Joe

Joe
Fri Jun 24 22:42:53 CDT 2005

Hi mayayana,

Actually, I think Torgeir is king of the reference link. ;-) He seems to
be able to answer a few dozen posts a day. He's probably just a bit
constrained here because of MS policy on the Common Dialog, even though it's
a peculiar policy that claims to be tied to proprietary programs (which MS
no longer supports anyway), on the one hand, and to give it away on the
other.

Besides, (a) you don't really want to see the truly *exhaustive* answer, and
(b) I'm going to be out of action here for a couple of weeks. I promise
that when I return, I'll drop off my OCD medication again.

Regards,
Joe


"mayayana" <mayaXXyana1a@mindYYspring.com> wrote in message
news:Gc1ve.12474$eM6.7233@newsread3.news.atl.earthlink.net...
> I vote that Joe Earnest be elected to write the
> exhaustive answer to that question and post it
> on the web somewhere, so that we can just
> answer the next post with "read this link". :)
>
> --
> --
> Joe Earnest <jearnest3-SPAM@earthlink.net> wrote in message
> news:eBBTwIPeFHA.412@tk2msftngp13.phx.gbl...
>> Hi,
>>
>> [bottom post]
>>
>> "jsl" <jennifer.lyon@ngc.com> wrote in message
>> news:1119633295.700736.286360@g47g2000cwa.googlegroups.com...
>> > writing a script to go through a collection of MS Project files in a
>> > folder and muck around with them in Project.
>> >
>> > Need to be able to have the user specify which file is the shared
>> > resource pool file...preferably through a dialog box rather than
>> > manually typing in the path/file name.
>> >
>> > Problem is that some of the users have Win2K and the others have XP.
>> > Which means that I can't exclusively use the XP specific common dialog
>> > way of doing business.
>> >
>> > I've tried plowing through the various script pages on MSDN and Technet
>> > to no avail for how to do a "select a file" dialog box on a Win2K
>> > system.
>> >
>> > Any advice/suggestions would be very helpful.
>> >
>>
>> The generic MsComDlg object is available on all Windows installations,
>> but
>> requires a license to activate it, which is usually obtained installation
> of
>> VB, Sudio or a similar product.
>>
>> If your network is not so large that it is a problem to install the
> license
>> on each machine where you'll use it, there are two free MS downloads that
>> install the MsComDlg license.
>>
>> VB5CCE, is still available as freeware from MS (at least it was as of a
> few
>> of weeks ago), even though it has been removed from the MS Download
>> Center
>> listing. It's a very useful program for wrapping your own occasional
>> COM,
>> but it's a very large download and installation, if all you're after is
> the
>> license.
>>
>> VB5CCE
>> http://download.microsoft.com/msdownload/sbn/vbcce/vb5ccein.exe
>>
>> VB5CCE Documentation
>>
> http://download.microsoft.com/download/5/2/5/5253a7ea-1310-40d8-b762-625c201
> 9310e/ccehelp.exe
>>
>>
>> Paul Randall pointed out a couple of weeks ago that the MS HTMLEditor
> sample
>> HTA also installs the license. It's a lightweight download with no
>> installation and can be easily deleted after the license is installed.
> The
>> first time that you run it, it will prompt you to install the license, if
>> it's not already installed on your computer.
>>
>>
> http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/samples/int
> ernet/author/html/htmleditor/default.asp
>>
>>
>> Also -- the OCX and INF files in a CAB file, unnecessary if you install
>> through one of the above.
>>
>> http://activex.microsoft.com/controls/vb5/comdlg32.cab
>>
>>
>> Syntax --
>>
>> MSDN, CommonDialog Control
>>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cmdlg98/htm
> l/vbobjCommonDialog.asp?frame=true
>>
>> MSDN, Flags Property (Open, Save As Dialogs)
>>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cmdlg98/htm
> l/vbproflagsfile.asp
>>
>>
>> If you don't want to go this route, there are two other possibilities.
>>
>> (1) If your Win2k installations were initially pre-SP4 and your WinXp
>> installations were pre-SP1a (SP1 or before), you have the MS Java VM
>> installed. Script can access the common dialog component of the VM.
>> Updates do not remove the VM, but this solution is not available for
>> newer
>> installations, per the resolution of the MS-Sun litigation. Credit
>> Alessandro Angeli for this method.
>>
>> If you want to pursue this possibility, post back.
>>
>> (2) You can use the IE object's Choose File popup from the Input-File
>> element as a file selection dialog. Literally dozens of versions of this
>> option have been posted on the scripting NGs and various websites. I
>> believe that original credit for this method goes to Walter Zachary and
> Tom
>> Lavedas.
>>
>>
> http://groups-beta.google.com/group/microsoft.public.scripting.wsh/browse_fr
> m/thread/f3061f3bc2da31f5/d95fd80c38520bd7?q=earnest+file+input+group:micros
> oft.public.scripting.*&rnum=1&hl=en#d95fd80c38520bd7
>>
>> As a final alternative, you can install a custom ActiveX to do this.
> There
>> are several around.
>>
>> http://www.jsware.net/jsware/boss.html
>>
>> Joe Earnest
>>
>>
>>
>>
>
>



Re: Newbie Common Dialog question by mayayana

mayayana
Sat Jun 25 09:19:06 CDT 2005

>
> Besides, (a) you don't really want to see the truly *exhaustive* answer

This question seems to need it. There are so many
aspects and things to know. I can't keep track
myself of which methods work on which systems.
This topic (and BrowseForFolder) makes a good case
for the need of a FAQ website.

> (b) I'm going to be out of action here for a couple of weeks. I promise
> that when I return, I'll drop off my OCD medication again.
>
Don't forget your sunscreen.
"OCD"?




Re: Newbie Common Dialog question by tlavedas

tlavedas
Sat Jun 25 14:52:56 CDT 2005

mayayana wrote:
> >
> >
> Don't forget your sunscreen.
> "OCD"?

Obsessive/compusive disorder

Tom Lavedas
==============


another openfile (scripting) option, a vbAccelerator third-party by mr_unreliable

mr_unreliable
Mon Jun 27 15:33:39 CDT 2005

This is a multi-part message in MIME format.
--------------010904060408020004030306
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

As was previously mentioned, there are some third-party controls out there
which may be used to show an openfile dialog.

Of course, this is not "pure" script. On-the-other-hand some of these
third party controls can do "more" for you than the "pure" script
methods.

After making that assertion, I thought I should go and find one.

The first place I looked was the Common Controls Replacement Project.
This a bunch of guys who are so arrogant that they think they can do
a better job of it than Microsoft. And, they generally succeed.

CCRP does have a file dialog control, but (sob!) it must be sited on
a form, and vbs ain't got no steekin' forms capability. For shame,
Microsoft!

Next, I looked at Steve McMahon's vbAccelerator site. Steve is another
guy that thinks he can do a better job of it than Microsoft also, and
he succeeds too. He even ties-one-hand-behind-his-back as well,
choosing to code stuff in vb that clearly ought to be coded in c++.

To get on with it, Steve has an actX object that will show an openfile
dialog from script, as well as all the other common dialogs (but that's
another story).

His object is called "Common Dialog Direct", which means that he is
generating the dialogs DIRECT-ly using api calls. The actX object is
found in his cmdlgd.dll, which you may download here:

http://www.vbaccelerator.com/home/VB/Code/Libraries/Common_Dialogs/Common_Dialog_Direct/VB5_Common_Dialog_Direct_Binary.asp

and a rather brief discussion of it can be found here:

http://www.vbaccelerator.com/home/VB/Code/Libraries/Common_Dialogs/Common_Dialog_Direct/article.asp

There is also a sample (vbs) script attached.

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)



p.s. If you look carefully at cmdlgd.dll with a typelib tool, you will
find that Steve gives you access to the Microsoft dialogs as well --
and without a license. Look for "vbGetOpenFileName". But of course
to use it you will have to install Microsoft's ocx.


--------------010904060408020004030306
Content-Type: text/plain;
name="vbAccel_OpenFileDialogDemo.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="vbAccel_OpenFileDialogDemo.txt"

' demo showing openfile dialog, using vbAccelerator's commondialog object, jw 26June05
' (note: this object if found in the dmdlgd.dll)...

Dim oCD : Set oCD = WScript.CreateObject("CommonDialogDirect.cCommonDialog", "oCD_") ' with events

Const OFN_PATHMUSTEXIST = &H800
Const OFN_FILEMUSTEXIST = &H1000
'
Dim m_OpenClick : m_bOpenClick = False ' as boolean
Dim m_bDialogClosed : m_bDialogClosed = False ' as boolean
' --- end of declarations and constants ----------

With oCD ' set up parameters...
.DialogTitle = " < vbAccelerator OpenFile Dialog Demo (from Script) > "
' a string that can specify the initial directory.
' .InitDir = "c:\windows\"
' (note: a "virtual folder" may also be specified as: "::{clsid}")...
.InitDir = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" ' "My Computer"
' .InitDir = "::{450D8FBA-AD25-11D0-98A8-0800361B1103}" ' "My Documents"
' .InitDir = "::{645FF040-5081-101B-9F08-00AA002F954E}" ' "Recycle Bin"

.Flags = OFN_PATHMUSTEXIST Or OFN_FILEMUSTEXIST

' in THIS case, vertical bars are used to separate the various filters,
' as using the (system standard) "null" characters would cause vbs
' to "throw up"...
.Filter = "Internet documents (*.HTM)|*.HTM|Text files (*.TXT)|*.TXT|All Files (*.*)|*.*"
.FilterIndex = 3 ' one-based, (i.e., show all files)...

.HookDialog = True ' "hooking" means subclass to detect events...
End With

oCD.ShowOpen ' show the (openfile) dialog (modally)

' show the file name selected...
If (m_bOpenClick) then ' the selection was ok
MsgBox("you selected: " & vbCrLf & vbCrLf _
& " " & oCD.FileName)

ElseIf (m_bDialogClosed And Not m_bOpenClick) then
MsgBox("you clicked CANCEL -- (or CLOSE without selecting) ")

Else
MsgBox("unknown termination event -- fire your incompetent scripter!!! ")

End If

Set oCD = nothing
WScript.Quit

' --- EVENT HANDLERS -----------------------------

Sub oCD_DialogOK(bCancel) ' "OK" (i.e., "open" button clicked)
m_bOpenClick = True ' means passed path+file exists tests

' bCancel is a return value, which tells the dialog that
' this choice is not acceptable...
bCancel = False ' don't cancel
End Sub

Sub oCD_DialogClose()
' MsgBox("DialogClose_Event")
m_bDialogClosed = True
End Sub

--------------010904060408020004030306--