次の方法で共有


UI2.Alert メソッド

Microsoft Office InfoPath フォームにカスタム テキスト メッセージと共にメッセージ ボックスを表示します。

名前空間: Microsoft.Office.Interop.InfoPath
アセンブリ: Microsoft.Office.Interop.InfoPath (microsoft.office.interop.infopath.dll 内)

構文

'宣言
<DispIdAttribute(1)> _
Sub Alert ( _
    <InAttribute> bstrAlertString As String _
)
'使用
Dim instance As UI2
Dim bstrAlertString As String

instance.Alert(bstrAlertString)
[DispIdAttribute(1)] 
void Alert (
    [InAttribute] string bstrAlertString
)

パラメータ

  • bstrAlertString
    表示されるテキスト。

コメント

Alert メソッドは、情報アイコンと [OK] ボタンが 1 つずつ配置された簡単なメッセージ ボックスを表示します。メッセージ ボックス内のテキストのみをカスタマイズできるようになっています。

メモメモ :

Visual C# コードでは、標準の 文字を使用して、カスタム メッセージ テキストに改行を挿入できます。

次の例では、UIObject オブジェクトの Alert メソッドを使用して、メッセージ ボックスを表示しています。

thisXDocument.UI.Alert("Custom message text goes here.");

関連項目

参照

UI2 インターフェイス
UI2 のメンバ
Microsoft.Office.Interop.InfoPath 名前空間