01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | 'TOC([コンテンツ] ウィンドウ)の選択アイテムへのアクセス Public Sub ContentsView() Dim pMxDocument As IMxDocument Set pMxDocument = ThisDocument Dim pContentsView As IContentsView3 Set pContentsView = pMxDocument.CurrentContentsView If TypeOf pContentsView.SelectedItem Is IMap Then Dim pMap As IMap se pMap = pContentsView.SelectedItem ElseIf TypeOf pContentsView.SelectedItem Is ILayer Then Dim pLayer As ILayer Set pLayer = pContentsView.SelectedItem ElseIf TypeOf pContentsView.SelectedItem Is ILegendGroup Then Dim pLegendGroup As ILegendGroup Set pLegendGroup = pContentsView.SelectedItem ElseIf TypeOf pContentsView.SelectedItem Is ILegendClass Then Dim pLegendClass As ILegendClass Set pLegendClass = pContentsView.SelectedItem Dim pSymbol As ISymbol Set pSymbol = pLegendClass.Symbol ElseIf TypeOf pContentsView.SelectedItem Is IWorkspace Then 'source view only Dim pWorkspace As IWorkspace Set pWorkspace = pContentsView.SelectedItem ElseIf TypeOf pContentsView.SelectedItem Is IDataset Then 'source view only Dim pDataset As IDataset Set pDataset = pContentsView.SelectedItem ElseIf TypeOf pContentsView.SelectedItem Is IStandaloneTable Then 'source view only Dim pStandaloneTable As IStandaloneTable Set pStandaloneTable = pContentsView.SelectedItem End If End Sub |
TOC の選択アイテムへのアクセス
2016/9/1 (木)