SteliosGietos
How can I prompt a user dialog for files selection like API function GetOpenFilename?
I want the use to select some images but not to open them... just to get an array list with their filenames.
Mediacy.Controls.Common.Vb.MCFileOpenDialog raises an error when select more than one file.
Thanks...
I want the use to select some images but not to open them... just to get an array list with their filenames.
Mediacy.Controls.Common.Vb.MCFileOpenDialog raises an error when select more than one file.
Thanks...
0
Answers
-
SteliosGietos,
If you want to show Open file dialog, then the standard OpenImage command will work, just leave FileNames property empty and the a prompt will be shown:Public Function PromptForImage() As SimpleScript PromptForImage = New SimpleScript Dim docList1 = New List(1), doc1 With Application.DocumentCommands.OpenImage(PromptForImage) .Filenames = Nothing .BestFitMode = True .GroupRelatedFiles = False .Run(docList1) End With With Application.DocumentCommands.Activate(PromptForImage) .Run(docList1(0), doc1) End With End Function
If you want to enumerate files in a folder and get names, then you can use standard .NET functions, such as EnumerateFiles:Public Sub GetListOfFiles Dim folder As String="D:\Images" 'change to your own folder Dim files=System.IO.Directory.EnumerateFiles(folder,"*.tif") For Each file As String In files Debug.Print (file) Next End Sub
Regards,
Yuri0 -
Thanks Yuri...
Your examples helped me a lot.
0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions