TextBoxesでの作業

Aspose.Wordsでは、TextBoxクラスを使用して、図形内のテキストの表示方法を指定します。 これは、顧客が関連付けられたTextBoxからリンクされたShapeを見つけることができるように、テキストボックスの親図形を取得するためにParentという名前の

リンクを作成する

TextBoxクラスはTextBoxがターゲットTextboxにリンクできるかどうかをチェックするためにIsValidLinkTargetメソッドを提供します。

次のコード例は、TextBoxをターゲットTextboxにリンクできるかどうかを確認する方法を示しています:

チェックTextBoxシーケンス

図形にテキストを表示するには、いくつかの方法があります。 TextBoxは、シーケンスの先頭、中央、または末尾にすることができます。

次のコード例は、TextBoxがシーケンスの頭、尾、または中央であるかどうかを確認する方法を示しています:

For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C
System::SharedPtr<Document> doc = System::MakeObject<Document>();
System::SharedPtr<Shape> shape = System::MakeObject<Shape>(doc, ShapeType::TextBox);
System::SharedPtr<TextBox> textBox = shape->get_TextBox();
if ((textBox->get_Next() != nullptr) && (textBox->get_Previous() == nullptr))
{
std::cout << "The head of the sequence" << std::endl;
}
if ((textBox->get_Next() != nullptr) && (textBox->get_Previous() != nullptr))
{
std::cout << "The Middle of the sequence." << std::endl;
}
if ((textBox->get_Next() == nullptr) && (textBox->get_Previous() != nullptr))
{
std::cout << "The Tail of the sequence." << std::endl;
}

リンクを解除する

BreakForwardLinkメソッドを使用すると、次のTextBoxへのリンクを解除できます。

次のコード例は、TextBoxのリンクを解除する方法を示しています: