| サイトマップ | |
||
トップ | オブジェクト | プロパティ | メソッド | 定数 |
SelectObject メソッド |
オブジェクト:Axis, Function, Graph, GraphObject, Group, Line, Page, Plot, Solid, Symbol, Text, Tuple
選択したグラフオブジェクトの属性を SetSelectedObjectsAttribute メソッドで変更するために、GraphItem オブジェクトの現在の選択リストを消去し、変更するグラフオブジェクトを選択します。Line オブジェクトと Solid オブジェクトは、描画オブジェクトの最上位にないと選択できません (他のオブジェクトの子オブジェクトになっていると選択できません)。
If ActiveDocument.CurrentPageItem.GraphPages(0).Graphs.Count > 1 Then ' Select the first graph on the page and turn it red. ActiveDocument.CurrentPageItem.GraphPages(0).Graphs(0).SelectObject ActiveDocument.CurrentPageItem.SetSelectedObjectsAttribute(SOA_COLOR,RGB_RED) ActiveDocument.CurrentPageItem.SetSelectedObjectsAttribute(STA_COLOR,RGB_RED) ' Select the second graph on the page and turn it green. ActiveDocument.CurrentPageItem.GraphPages(0).Graphs(1).SelectObject ActiveDocument.CurrentPageItem.SetSelectedObjectsAttribute(SOA_COLOR,RGB_GREEN) ActiveDocument.CurrentPageItem.SetSelectedObjectsAttribute(STA_COLOR,RGB_GREEN) Else MsgBox("This macro requires 2 graphs on the page.",0+48,"Error") End If