Solid Edge Framework Type Library
GetOpenFileName Method
This option is not supported in this release.
This option is not supported in this release.
Member of the DocumentAccess constant set that specifies the read-write access by which the specified document should be opened.
Member of the NotifyOption constant set that specifies the notification requested by the user on the selected document.
Specifies a variable to receive the document relations automation object, which can be used to enumerate specified linked documents.
Specifies the file filters or translators available to the application. The filter string consists of pairs of file filter strings followed by the MS-DOS wildcard file filter specification, with each part and each pair separated by commas. For example, the following string specifies a text file filter: "Text Files (*.txt),*.txt". To use multiple MS-DOS wildcard expressions for a single file filter type, separate the wildcard expressions with semicolons. For example: "Solid Edge Files (*.asm; *.prt),*.asm;*.prt". If omitted, this argument defaults to "All Files (*.*),*.*".
Specifies the index number in the FileFilter array indicating the default filter to be used. If this argument is omitted or negative or greater than the number of filters present, the first file filter is used.
Specifies the dialog title. If this argument is omitted, the dialog title is "Open".
If the argument is True, the user is not prompted with warning dialog boxes regarding the file availability, and default action is taken. If the argument is False, the warning dialogs are presented to the user. If the argument is omitted, the warning dialogs are presented to the user.
Description
Displays the File Open dialog box.
Syntax
Visual Basic
Public Function GetOpenFileName( _
   ByRef LinksUpdate As LinksUpdateOption, _
   ByRef AltLinkPath As String, _
   ByRef DocAccess As DocumentAccess, _
   ByRef OptNotify As NotifyOption, _
   ByRef DocRelationAutoServer As Object, _
   Optional ByVal FileFilter As Variant, _
   Optional ByVal FilterIndex As Variant, _
   Optional ByVal Title As Variant, _
   Optional ByVal IgnoreWarnings As Variant _
) As Variant
Parameters
LinksUpdate
ValueDescription
igLinksUpdateWithAltPathUpdate links with alternate path
igLinksUpdateWithDefpathUpdate links with default path
igNoLinksUpdateDo not update links
This option is not supported in this release.
AltLinkPath
This option is not supported in this release.
DocAccess
ValueDescription
igReadExclusiveDocument has exclusive read access
igReadOnlyDocument has read-only access
igReadWriteDocument has read-write access
Member of the DocumentAccess constant set that specifies the read-write access by which the specified document should be opened.
OptNotify
ValueDescription
igNoNotifyDo not notify
igNotifyWhenAvailableNotify when the document is available
igNotifyWhenExclusiveNotify when the document is exclusive
igNotifyWhenReadableNotify when the document can be read
igNotifyWhenWriteableNotify when the document can be written
Member of the NotifyOption constant set that specifies the notification requested by the user on the selected document.
DocRelationAutoServer
Specifies a variable to receive the document relations automation object, which can be used to enumerate specified linked documents.
FileFilter
Specifies the file filters or translators available to the application. The filter string consists of pairs of file filter strings followed by the MS-DOS wildcard file filter specification, with each part and each pair separated by commas. For example, the following string specifies a text file filter: "Text Files (*.txt),*.txt". To use multiple MS-DOS wildcard expressions for a single file filter type, separate the wildcard expressions with semicolons. For example: "Solid Edge Files (*.asm; *.prt),*.asm;*.prt". If omitted, this argument defaults to "All Files (*.*),*.*".
FilterIndex
Specifies the index number in the FileFilter array indicating the default filter to be used. If this argument is omitted or negative or greater than the number of filters present, the first file filter is used.
Title
Specifies the dialog title. If this argument is omitted, the dialog title is "Open".
IgnoreWarnings
If the argument is True, the user is not prompted with warning dialog boxes regarding the file availability, and default action is taken. If the argument is False, the warning dialogs are presented to the user. If the argument is omitted, the warning dialogs are presented to the user.
Remarks
This method displays the File Open dialog box. This is the same dialog box that is displayed when the user selects Open from the File menu. This dialog box allows a user to browse files in the file system and to select a file to open. This method returns the file name without actually opening it. The selected filter is not returned, but it can be determined from the file type of the returned file. Displays a preview of a selected document and its state. When available, a thumbnail preview of the currently selected document is provided. An icon that describes the state of the document is also displayed. Provides a way to specify a directory path to override the location of document links. Provides access to the Compound page in which the user can select which linked documents should be activated.
Example
Imports System.IO
Imports System.Runtime.InteropServices

Module Example
    <STAThread()> _
    Sub Main()
        Dim objApplication As SolidEdgeFramework.Application = Nothing
        Dim strAltLinkPath As String
        Dim linksUpdateOptions As SolidEdgeFramework.LinksUpdateOption
        Dim documentAccess As SolidEdgeFramework.DocumentAccess
        Dim notifyOption As SolidEdgeFramework.NotifyOption
        Dim objDocRelationAutoServer As Object = Nothing
        Dim strFilePath As String
        Dim strFilter As String

        Try
            OleMessageFilter.Register()

            objApplication = Activator.CreateInstance(Type.GetTypeFromProgID("SolidEdge.Application"))
            objApplication.Visible = True

            linksUpdateOptions = SolidEdgeFramework.LinksUpdateOption.igNoLinksUpdate
            strAltLinkPath = String.Empty
            documentAccess = SolidEdgeFramework.DocumentAccess.igReadOnly
            notifyOption = SolidEdgeFramework.NotifyOption.igNoNotify

            strFilter = "Solid Edge Files (*.asm; *.par; *.dft; *.psm; *.pwd), *.asm; *.par; *.dft; *.psm; *.pwd"
            strFilter &= ", Assembly Files (*.asm), *.asm"
            strFilter &= ", Part Files (*.par), *.par"
            strFilter &= ", Draft Files (*.dft), *.dft"
            strFilter &= ", Sheet Metal Files (*.psm), *.psm"
            strFilter &= ", Weldement Files (*.pwd), *.pwd"

            strFilePath = objApplication.GetOpenFileName(linksUpdateOptions, strAltLinkPath, documentAccess, notifyOption, objDocRelationAutoServer, strFilter)
            Console.WriteLine(strFilePath)

        Catch ex As Exception
            Console.WriteLine(ex.Message)
        Finally
            OleMessageFilter.Revoke()
        End Try
    End Sub
End Module
See Also

Application Object  | Application Members