動作検証バージョン:64bit Windows 10 Pro + 32bit Wordバージョン2102 ビルド13801.20266 Microsoft Store)
拙著『Excel VBAユーザーのためのWord VBA入門(1)』の、「6-7. ParagraphsはParagraphと同じメソッド・プロパティを多く持つ」で、コレクションに用意されているプロパティやメソッドは、要素である単独のオブジェクトよりも少ないのが一般的であるとお伝えしています。
この一般論とはまったく逆に、Word VBAには、コレクションより単独のオブジェクトのほうが、たくさんのプロパティ・メソッドを持っているケースがあります。
罫線を表すBordersコレクションとBorderオブジェクトの場合、コレクションのほうが多くのプロパティを持っています。
そんなBordersコレクションとBorderオブジェクトに用意されているプロパティを、比較するための一覧を作成しておきます。
| Borders のプロパティ | 戻り値 | Border のプロパティ | 戻り値 |
|---|---|---|---|
| AlwaysInFront | Boolean | - | |
| Application | Application | Application | Application |
| - | ArtStyle | WdArtStyle | |
| - | ArtWidth | Long | |
| - | Color | WdColor | |
| - | ColorIndex | WdColorIndex | |
| Count | Long | - | |
| Creator | Long | Creator | Long |
| DistanceFrom | WdBorderDistanceFrom | - | |
| DistanceFromBottom | Long | - | |
| DistanceFromLeft | Long | - | |
| DistanceFromRight | Long | - | |
| DistanceFromTop | Long | - | |
| Enable | Long | - | |
| Enable FirstPageInSection | Boolean | - | |
| Enable OtherPagesInSection | Boolean | - | |
| HasHorizontal | Boolean | - | |
| HasVertical | Boolean | - | |
| - | Inside | Boolean | |
| InsideColor | WdColor | - | |
| InsideColorIndex | WdColorIndex | - | |
| InsideLineStyle | WdLineStyle | - | |
| InsideLineWidth | WdLineWidth | - | |
| JoinBorders | Boolean | - | |
| - | LineStyle | WdLineStyle | |
| - | LineWidth | WdLineWidth | |
| OutsideColor | WdColor | - | |
| OutsideColorIndex | WdColorIndex | - | |
| OutsideLineStyle | WdLineStyle | - | |
| OutsideLineWidth | WdLineWidth | - | |
| Parent | Object | Parent | Object |
| Shadow | Boolean | - | |
| SurroundFooter | Boolean | - | |
| SurroundHeader | Boolean | - | |
| - | Visible | Boolean |
Borderオブジェクトにメソッドはない
メソッドについては、Borderオブジェクトには用意されておらず、Bordersコレクションには、
ApplyPageBordersToAllSectionsメソッド
Itemメソッド
の2つが存在します。
最終更新日時:2022-09-14 14:10
[スポンサードリンク]
Home » ワードマクロ・Word VBAの使い方 » WordのBordersとBorderが持つプロパティの比較一覧

『インストラクターのネタ帳』では、2003年10月からMicrosoft Officeの使い方などを紹介し続けています。










