Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Can DIAdem Open a Better File Dialog Windows than the One Returned by the PathNameGet Function?

Primary Software: DIAdem
Primary Software Version: 10
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I am currently using the PathNameGet function in my VB Script so users can navigate to and select a file they want to open. The code I use to run this function is the following:

Dim selectedFile
selectedFile = PathNameGet


Is there any way to open a window with more features than those available with the PathNameGet function?


Solution:
The Windows API lets you leverage its Common Dialog which is used extensively in most applications when you click on the menu item File >> Open. In order to use the Common Dialog you have to create a Common Dialog object. The code necessary to create the object is the following:

Set CmnDlgObj = CreateObject("UserAccounts.CommonDialog")

Once you create the object you can use it's ShowOpen function to open the window and return the file name. The following code demonstrates how to use the ShowOpen function:

fileName = CmnDlgObjShowOpen

Note: The Common Dialog is only available in Windows XP.


Related Links:
NI Support: DIAdem Support Page

Attachments:





Report Date: 03/22/2006
Last Updated: 04/14/2006
Document ID: 3VLJ4IO8

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit