OOobbs2/94
質問
お世話になります。 Calcにおいて、ユーザー定義順序リストの追加、削除及びリストのIndexの取得方法が調べてみたのですが全く解りません。 可能ならばよろしくお願いいたします。 例1月〜12月の並び替え他 回答
型は string-list なので値は配列です。要素ごとに定義リストの定義を含み、定義リストの要素はコンマ "," で区切ります。 値は次のようにして取得します。 Sub Main sNode = "org.openoffice.Office.Calc/SortList" oCP = CreateUnoService( _ "com.sun.star.configuration.ConfigurationProvider") Dim oNode(0) As New com.sun.star.beans.PropertyValue oNode(0).Name = "nodepath" oNode(0).Value = sNode oCUA = oCP.createInstanceWithArguments( _ "com.sun.star.configuration.ConfigurationUpdateAccess", oNode ) sList = oCUA.getPropertyValue("List") 'sList(4) = sList(5) 'ReDim Preserve sList(4) 'oCUA.setPropertyValue("List",sList) ' change the property value 'oCUA.commitChanges() ' commit msgbox sList(0) End Sub リストの形式 sList(0) = "Sun,Mon,Tue,Wed,Thu,Fri,Sat" sList(1) = "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday" sList(2) = ... 変更するときには変更済みの配列を setPropertyValue で設定したのちに commitChanges を行います。
感想,コメント,メモ
|