ReadLine objTextFile. Close objFSO. To clarify, copy and paste dieseyer. It even returns UNC paths correctly. The result is the full pathname with a lineend char at the end. The next post uses the replace function to correct this. Of course you need to install and register mscomdlg Office Office Exchange Server. Not an IT pro? Script Center. Sign in. United States English.
Ask a question. Quick access. Search related threads. Remove From My Forums. Answered by:. Archived Forums. The Official Scripting Guys Forum! If your answer is "yes," you know what to do. Dive in and help somebody! If your answer is "no," welcome to our fun little world! We'd recommend that you first head over to the Script Center, get your feet wet, and then come back to either ask or answer questions. We can't be everywhere at once we know—shocking!
The Microsoft Scripting Guys 8 7. Sign in to vote. Monday, July 19, PM. Mark the best replies as answers. Friday, July 23, AM. Have you tried this? Ensure that mscomdlg32ocx is registered for this to work.
CommonDialog" With objDialog. Echo "You pressed 'Cancel' please try again. Quit Else WScript. Echo objDialog.
FileName End If. Tuesday, July 20, AM. I download the mscomdlg The second group 16, 32, 48, 64 describes the sytle of the icon to be displayed, the third group 0, , , indicates which button must be the default, and the fourth group 0, determines the modality of the message box. When the above script is executed, the message box is displayed, and if you press No Button, then the value of a is 7. The InputBox function helps the user to get the values from the user. If the user clicks on the Cancel button, the function will return an empty string "".
A default text in the text box that the user would like to be displayed. The Position of X axis which represents the prompt distance from left side of the screen horizontally.
If left blank, the input box is horizontally centered. The Position of Y axis which represents the prompt distance from left side of the screen Vertically.
If left blank, the input box is Vertically centered. A String expression that identifies the Help file to use to provide context-sensitive Help for the dialog box. When the above script is executed, the input box is displayed and displays the entered value by the user. Join Us! By joining you are opting in to receive e-mail. Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Students Click Here. CommonDialog" is no longer available? In case anyone is interested, here's an example of what I wound up using to browse for a file and return its name and path.
The advantage is that it doesn't look at zip files! Others may find this useful, so I encourage you to take a few minutes, comment the code and post it to the FAQ section of the Forum. This is strange. Before I started to comment the code, I copied the script I posted and ran it on my machine. I never noticed this because I was focused on Excel files at the time.
The most puzzling thing to me is that both Excel file types worked fine, but the new Word file type worked while the old one did not. I'm going to try and figure this out before I post anything else. BrowseForFolder returns a folder object. Perhaps this will work for you?
I decide to give up on BrowseForFolder. I've been playing around with the dialog from Word, instead.
0コメント