Share via


Shape.Characters プロパティ (Visio)

図形のテキストを表す Characters オブジェクトを返します。 読み取り専用です。

構文

Characters

Shape オブジェクトを表す変数。

戻り値

文字

注釈

Visual Studio ソリューションに Microsoft.Office.Interop.Visio リファレンスが含まれている場合、このプロパティは次の種類にマップされます。

  • Microsoft.Office.Interop.Visio.IVShape.Characters

次の Microsoft Visual Basic for Applications (VBA) マクロは、図形の Characters プロパティを使用して Characters オブジェクトを取得します。 この例では、Characters オブジェクトの取得後、Characters オブジェクトの Shape プロパティを使用して、文字を含む図形を取得し、その図形が取得されたものであることがわかるように、イミディエイト ウィンドウにそのテキストを表示します。

 
Public Sub Characters_Example() 
  
    Dim vsoOval As Visio.Shape  
    Dim vsoShapeFromCharacters As Visio.Shape  
    Dim vsoCharacters As Visio.Characters  
 
    'Create a shape and add text to it. 
    Set vsoOval = ActivePage.DrawOval(2, 5, 5, 7)  
    vsoOval.Text = "Rectangular Shape"  
 
    'Get a Characters object from the oval shape. 
    Set vsoCharacters = vsoOval.Characters  
 
    'Set the Begin and End properties so that we can 
    'replace the word "Rectangular" with "Oval" 
    vsoCharacters.Begin = 0 
    vsoCharacters.End = 11 
    vsoCharacters.Text = "Oval" 
 
    'Use the Shape property of the Characters object 
    'to get the Shape object. 
    Set vsoShapeFromCharacters = vsoCharacters.Shape  
 
    'Print the shape's text to verify that the proper Shape 
    'object was returned.  
    Debug.Print vsoShapeFromCharacters.Text 
  
End Sub

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。