'GxDialogの使用 Publig Sub ShowGxDialogUsingJPGFilter() Dim pGxDialog As IGxDialog Set pGxDialog = New GxDialog Dim pGxObjectFilterCollection As IGxObjectFilterCollection Set pGxObjectFilterCollection = pGxDialog Dim pGxObjectFilter As IGxObjectFilter Set pGxObjectFilter = New RasterFormatJPGFilter 'RasterFormatJPGFilter ※このクラスは使用できない 'RasterFormatBMPFilter Set pGxDialog.ObjectFilter = pGxObjectFilter ' pGxObjectFilterCollection.AddFilter pGxObjectFilter, True '複数フィルタを設定する場合に使用 pGxDialog.AllowMultiSelect = False pGxDialog.ButtonCaption = "開く" pGxDialog.Title = "JPGを選択" Dim pEnumGxObject As IEnumGxObject pGxDialog.DoModalOpen 0, pEnumGxObject pEnumGxObject.Reset Dim pGxObject As IGxObject Set pGxObject = pEnumGxObject.Next If pGxObject Is Nothing Then Exit Sub ElseIf TypeOf pGxObject Is IGxDataset Then Dim pGxDataset As IGxDataset Set pGxDataset = pGxObject ' pGxDataset.Dataset '<--これがRasterDatasetオブジェクト Debug.Print pGxDataset.DatasetName.WorkspaceName.PathName 'フォルダパス Debug.Print pGxDataset.Dataset.Name 'ファイル名 End If End Sub
GxDialog の使用
2016/9/1 (木)