Share via


チュートリアル : 実行時のリボン コントロールの更新

更新 : 2007 年 11 月

対象

このトピックの情報は、指定された Visual Studio Tools for Office プロジェクトおよび Microsoft Office のバージョンにのみ適用されます。

プロジェクトの種類

  • ドキュメント レベルのプロジェクト

  • アプリケーション レベルのプロジェクト

Microsoft Office のバージョン

  • Excel 2007

  • Word 2007

  • Outlook 2007

  • PowerPoint 2007

詳細については、「アプリケーションおよびプロジェクトの種類別の使用可能な機能」を参照してください。

このチュートリアルでは、Office アプリケーションへのリボンの読み込み後にリボン オブジェクト モデルを使用してリボン上のコントロールを更新する方法を説明します。

この例では、AdventureWorks サンプル データベースからデータを取得し、Microsoft Office Outlook のコンボ ボックスとメニューに追加します。

このチュートリアルでは、次のタスクについて説明します。

  • 新しい Outlook アドイン プロジェクトの作成

  • カスタム リボン グループのデザイン

  • 組み込みタブへのカスタム グループの追加

  • 実行時のリボン コントロールの更新

Bb608628.alert_note(ja-jp,VS.90).gifメモ :

次の手順で参照している Visual Studio ユーザー インターフェイス要素の一部は、お使いのコンピュータでは名前や場所が異なる場合があります。これらの要素は、使用する Visual Studio のエディションとその設定によって決まります。詳細については、「Visual Studio の設定」を参照してください。

前提条件

このチュートリアルを完了するには、次のコンポーネントが必要です。

  • Visual Studio Tools for Office (Visual Studio 2008 Professional および Visual Studio Team System のオプションの要素)

  • Microsoft Office Outlook 2007

  • SQL Server Express 用の AdventureWorks サンプル データベースへのアクセス。AdventureWorks データベースのインストール方法の詳細については、「チュートリアル : AdventureWorks データベースのインストール」を参照してください。

ここに挙げた Visual Studio のバージョンでは、Visual Studio Tools for Office が既定でインストールされます。インストールされているかどうかを確認する方法については、「Visual Studio Tools for Office のインストール」を参照してください。

新しい Outlook アドイン プロジェクトの作成

まず、Outlook アドイン プロジェクトを作成します。

新しい Outlook アドイン プロジェクトを作成するには

  1. Visual Studio で、MyOutlookAddIn という名前の Outlook 2007 アドイン プロジェクトを作成します。

  2. [新しいプロジェクト] ダイアログ ボックスの [ソリューションのディレクトリを作成] チェック ボックスをオンにします。

  3. プロジェクトを既定のプロジェクト ディレクトリに保存します。

    詳細については、「方法 : Visual Studio Tools for Office プロジェクトを作成する」を参照してください。

カスタム リボン グループのデザイン

リボンは Outlook のメイン インターフェイス領域には表示されないため、この例のリボンはユーザーが新しいメール メッセージを作成したときに表示されます。リボンのカスタム グループを作成するには、まずプロジェクトにリボン項目を追加し、次にリボン デザイナでカスタム グループをデザインします。このカスタム グループでは、データベースから顧客名と注文履歴を取得して、顧客へのフォローアップ電子メール メッセージを作成できます。

カスタム グループをデザインするには

  1. [プロジェクト] メニューの [新しい項目の追加] をクリックします。

  2. [新しい項目の追加] ダイアログ ボックスで、[リボン (ビジュアル デザイナ)] をクリックします。

  3. 新しいリボンの名前を CustomerRibbon に変更し、[追加] をクリックします。

    リボン デザイナで CustomerRibbon.cs ファイルまたは CustomerRibbon.vb ファイルが開き、既定のタブとグループが表示されます。

  4. リボン デザイナをクリックして選択します。

  5. [表示] メニューの [プロパティ ウィンドウ] をクリックします。

  6. [プロパティ] ウィンドウで、[RibbonType] プロパティの隣のドロップダウン矢印をクリックし、[Microsoft.Outlook.Mail.Compose] をクリックします。

    これにより、ユーザーが Outlook で新しいメール メッセージを作成するときにリボンが表示されます。

  7. リボン デザイナで [Group1] をクリックして選択します。

  8. [プロパティ] ウィンドウで、[ラベル] を Customer Purchases に設定します。

  9. [ツールボックス][Office リボン コントロール] タブから ComboBox[Customer Purchases] グループにドラッグします。

  10. [ComboBox1] をクリックして選択します。

  11. [プロパティ] ウィンドウで、[ラベル] を Customers に設定します。

  12. [ツールボックス][Office リボン コントロール] タブから Menu[Customer Purchases] グループにドラッグします。

  13. [プロパティ] ウィンドウで、[ラベル] を Product Purchased に設定します。

  14. [ダイナミック] を true に設定します。

    これにより、リボンが Office アプリケーションに読み込まれた後で、実行時にメニュー上のコントロールを追加および削除できます。

カスタム グループの組み込みタブへの追加

組み込みタブは、Outlook インスペクタのリボンに始めから含まれているタブです。この手順では、組み込みタブにカスタム グループを追加し、タブ上のカスタム グループの位置を指定します。

組み込みタブにカスタム グループを追加するには

  1. [TabAddIns (ビルトイン)] タブをクリックして選択します。

  2. [プロパティ] ウィンドウで、[ControlId] プロパティを展開し、[OfficeId] を TabNewMailMessage に設定します。

    [Customer Purchases] グループが新しいメール メッセージ内に表示されるリボンの [Messages] タブに追加されます。

  3. [Customer Purchases] グループをクリックして選択します。

  4. [プロパティ] ウィンドウで、[位置] プロパティを展開し、[PositionType] プロパティの隣にあるドロップダウン矢印をクリックします。次に、[BeforeOfficeId] をクリックします。

  5. [OfficeId] プロパティを GroupClipBoard に設定します。

    これにより、[Customer Purchases] グループが [Messages] タブの [Clipboard] グループの前に配置されます。

実行時のカスタム グループのコントロールの更新

リボン オブジェクト モデルを使用して、以下のタスクを実行します。

  • [Customers] コンボ ボックスに顧客名を追加する。

  • [Products Purchased] メニューに販売注文と販売済み製品を表すメニュー コントロールおよびチェック ボックス コントロールを追加する。

  • [Customers] コンボ ボックスと [Products Purchased] メニューを使用して、新しいメール メッセージの Microsoft.Office.Interop.Outlook.MailItem.ToMicrosoft.Office.Interop.Outlook.MailItem.SubjectMicrosoft.Office.Interop.Outlook.MailItem.Body の各フィールドにデータを追加する。

リボン オブジェクト モデルを使用してカスタム グループのコントロールを更新するには

  1. [プロジェクト] メニューの [参照の追加] をクリックします。

  2. [参照の追加] ダイアログ ボックスで、[.NET] タブをクリックし、System.Data.Linq アセンブリを選択して、[OK] をクリックします。

    このアセンブリには、統合言語クエリ (LINQ: Language-Integrated Query) を使用するためのクラスが含まれています。ここでは、LINQ を使用して、カスタム グループのコントロールに AdventureWorks データベースから取得したデータを追加します。LINQ の詳細については、「統合言語クエリ (LINQ: Language-Integrated Query)」を参照してください。

  3. ソリューション エクスプローラで、CustomerRibbon.cs または CustomerRibbon.vb をクリックして選択します。

  4. [表示] メニューの [コード] をクリックします。

    コード エディタでリボン コード ファイルが開きます。

  5. リボン コード ファイルの先頭に次のステートメントを追加します。これらのステートメントによって、LINQ 名前空間や Outlook プライマリ相互運用機能アセンブリ (PIA) の名前空間に容易にアクセスできます。

    Imports Microsoft.Office.Tools.Ribbon
    Imports System.Data.Linq
    Imports System.Linq
    Imports System.Data.Linq.Mapping
    Imports System.Linq.Expressions
    Imports Outlook = Microsoft.Office.Interop.Outlook
    
    using System.Data.Linq;
    using System.Linq;
    using System.Data.Linq.Mapping;
    using System.Linq.Expressions;
    using Outlook = Microsoft.Office.Interop.Outlook;
    using System.IO;
    
  6. リボン コード ファイルに次のクラスを追加します。これらのクラスを使用して、AdventureWorks データベースの Customer、Contact、Sales Order Header、Sales Order Detail、Product の各テーブルの情報を格納します。

    ' Customer Table.
    <Table(Name:="Sales.Customer")> _
    Public Class Customer
        <Column(IsPrimaryKey:=True)> _
            Public CustomerID As Integer
    End Class
    
    ' Contact Table.
    <Table(Name:="Person.Contact")> _
    Public Class Contact
        <Column(IsPrimaryKey:=True)> _
           Public ContactID As Integer
        <Column()> _
        Public LastName As String
    
    End Class
    ' Sales Order Header Table.
    <Table(Name:="Sales.SalesOrderHeader")> _
    Public Class SalesOrderHeader
        <Column(IsPrimaryKey:=True)> _
           Public SalesOrderID As Integer
        <Column()> _
       Public SalesOrderNumber As String
        <Column()> _
        Public CustomerID As Integer
    End Class
    
    ' Sales Order Detail Table.
    <Table(Name:="Sales.SalesOrderDetail")> _
    Public Class SalesOrderDetail
        <Column(IsPrimaryKey:=True)> _
           Public SalesOrderDetailID As Integer
        <Column()> _
       Public SalesOrderID As Integer
        <Column()> _
        Public ProductID As Integer
    End Class
    
    ' Product Table.
    <Table(Name:="Production.Product")> _
    Public Class Product
        <Column(IsPrimaryKey:=True)> _
           Public ProductID As Integer
        <Column()> _
        Public Name As String
    End Class
    ' Data Context Class.
    Partial Public Class AdventureWorks
        Inherits DataContext
        Public Customer As Table(Of Customer)
        Public Contact As Table(Of Contact)
        Public SalesOrderHeader As Table(Of SalesOrderHeader)
        Public SalesOrderDetail As Table(Of SalesOrderDetail)
        Public Product As Table(Of Product)
        Public Sub New(ByVal connection As String)
            MyBase.New(connection)
        End Sub
    End Class
    
    // Customer Table.
    [Table(Name = "Sales.Customer")]
    public class Customer
    {
        [Column(IsPrimaryKey = true)]
        public int CustomerID;
    }
    
    // Contact Table.
    [Table(Name = "Person.Contact")]
    public class Contact
    {
        [Column(IsPrimaryKey = true)]
        public int ContactID;
        [Column]
        public string LastName;
    
    }
    // Sales Order Header Table.
    [Table(Name = "Sales.SalesOrderHeader")]
    public class SalesOrderHeader
    {
        [Column(IsPrimaryKey = true)]
        public int SalesOrderID;
    
        [Column]
        public string SalesOrderNumber;
    
        [Column]
        public int CustomerID;
    
    }
    // Sales Order Detail Table.
    [Table(Name = "Sales.SalesOrderDetail")]
    public class SalesOrderDetail
    {
        [Column(IsPrimaryKey = true)]
        public int SalesOrderDetailID;
    
        [Column]
        public int SalesOrderID;
    
        [Column]
        public int ProductID;
    
    }
    // Product Table.
    [Table(Name = "Production.Product")]
    public class Product
    {
        [Column(IsPrimaryKey = true)]
        public int ProductID;
    
        [Column]
        public string Name;
    
    }
    // Data Context Table.
    public partial class AdventureWorks : DataContext
    {
        public Table<Customer> Customer;
        public Table<Contact> Contact;
        public Table<SalesOrderHeader> SalesOrderHeader;
        public Table<SalesOrderDetail> SalesOrderDetail;
        public Table<Product> Product;
        public AdventureWorks(string connection) : base(connection) { }
    }
    
  7. CustomerRibbon_Load イベント ハンドラ メソッドを次のコードで置き換えます。このコードでは、LINQ クエリを使用して以下のタスクを実行します。

    • AdventureWorks データベースに登録されている 20 の顧客の ID と名前を [Customers] コンボ ボックスに追加する。

    • PopulateSalesOrderInfo ヘルパー メソッドを呼び出す。このメソッドは、現在選択されている顧客の販売注文番号で [ProductsPurchased] メニューを更新します。

     Private Sub CustomerRibbon_Load(ByVal sender As System.Object, _
    ByVal e As Microsoft.Office.Tools.Ribbon.RibbonUIEventArgs) _
        Handles MyBase.Load
    
         Dim programFilesDir As String = Environment.GetFolderPath _
         (Environment.SpecialFolder.ProgramFiles)
         Dim db As New AdventureWorks(programFilesDir + _
             "\Microsoft SQL Server\" + "MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf")
    
         Dim customerQuery = From customers In db.Customer.Take(20), contact In db.Contact _
                             Where customers.CustomerID = contact.ContactID _
                 Select CustomerID = customers.CustomerID, LastName = _
                     contact.LastName
    
         ' Execute the query.
         For Each item In customerQuery
             Me.ComboBox1.Items.Add(New RibbonDropDownItem())
             Me.ComboBox1.Items.Last().Label = item.CustomerID.ToString() _
                 + "|" + item.LastName
         Next item
    
         Me.ComboBox1.Text = Me.ComboBox1.Items.First().Label
         PopulateSalesOrderInfo()
     End Sub
    
    
    private void CustomerRibbon_Load(object sender, RibbonUIEventArgs e)
    {
        string programFilesDir = Environment.GetFolderPath
            (Environment.SpecialFolder.ProgramFiles);
        AdventureWorks db = new AdventureWorks
            (programFilesDir + "\\Microsoft SQL Server\\" + 
        "MSSQL.1\\MSSQL\\Data\\AdventureWorks_Data.mdf");
        var customerQuery = from customers in db.Customer.Take(20)
                            join contacts in db.Contact on 
                                customers.CustomerID 
                            equals contacts.ContactID
                            select new { customers.CustomerID, 
                                contacts.LastName };
    
    
        // Execute the query.
        foreach (var item in customerQuery)
        {
            this.comboBox1.Items.Add(new RibbonDropDownItem());
            this.comboBox1.Items.Last().Label = 
                item.CustomerID.ToString() + "|" + item.LastName;
        }
        this.comboBox1.Text = this.comboBox1.Items.First().Label;
        PopulateSalesOrderInfo();
    }
    
  8. CustomerRibbon クラスに次のコードを追加します。このコードでは、LINQ クエリを使用して以下のタスクを実行します。

    • 選択された顧客の個々の販売注文に対応するサブメニューを [ProductsPurchased] メニューに追加する。

    • 販売注文に関連する製品に対応するチェック ボックスを各サブメニューに追加する。

    • 各チェック ボックスにイベント ハンドラを追加する。

     Private Sub PopulateSalesOrderInfo()
    
         Dim tempArray As [String]() = comboBox1.Text.Split(New [Char]() {"|"c})
         Menu1.Items.Clear()
         Dim programFilesDir As String = Environment.GetFolderPath _
             (Environment.SpecialFolder.ProgramFiles)
         Dim db As New AdventureWorks(programFilesDir + _
             "\Microsoft SQL Server\" + "MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf")
    
    
         Dim orderQuery = From orders In db.SalesOrderHeader _
                          Where orders.CustomerID.ToString() = tempArray(0) _
                          Select SalesOrderID = _
                              orders.SalesOrderID, SalesOrderNumber = _
                                  orders.SalesOrderNumber
    
         For Each orderItem In orderQuery
             Dim Menu2 As New RibbonMenu()
             Menu2.Dynamic = True
             Menu1.Items.Add(Menu2)
             CType(Menu1.Items.Last(), RibbonMenu).Label = _
                 orderItem.SalesOrderNumber.ToString()
             CType(Menu1.Items.Last(), RibbonMenu).Tag = _
                 orderItem.SalesOrderID
    
             Dim productQuery = From orderDetail In db.SalesOrderDetail, _
                                    product In db.Product _
                                Where orderDetail.ProductID = _
                                    product.ProductID _
                                And orderDetail.SalesOrderID = _
                                orderItem.SalesOrderID _
             Select productName = product.Name
    
             For Each productItem In productQuery
                 CType(Menu1.Items.Last(), RibbonMenu).Items.Add _
                     (New RibbonCheckBox())
                 CType(CType(Menu1.Items.Last(),  _
    RibbonMenu).Items.Last(), RibbonCheckBox).Label = productItem
                 AddHandler (CType(CType(Menu1.Items.Last(),  _
    RibbonMenu).Items.Last(), RibbonCheckBox).Click), AddressOf CheckBox_Click
    
             Next productItem
         Next orderItem
     End Sub
    
    
    
    
    private void PopulateSalesOrderInfo()
    {
        String[] tempArray = comboBox1.Text.Split(new Char[] { '|' });
        menu1.Items.Clear();
        string programFilesDir = Environment.GetFolderPath
            (Environment.SpecialFolder.ProgramFiles);
        AdventureWorks db = new AdventureWorks
            (programFilesDir + "\\Microsoft SQL Server\\" +
                "MSSQL.1\\MSSQL\\Data\\AdventureWorks_Data.mdf");
    
        var orderQuery = from orders in db.SalesOrderHeader
                         where orders.CustomerID.ToString() == tempArray[0]
                         select new { orders.SalesOrderID, 
                             orders.SalesOrderNumber };
    
        foreach (var orderItem in orderQuery)
        {
            RibbonMenu menu2 = new RibbonMenu();
            menu2.Dynamic = true;
            menu1.Items.Add(menu2);
            ((RibbonMenu)menu1.Items.Last()).Label = 
                orderItem.SalesOrderNumber.ToString();
            ((RibbonMenu)menu1.Items.Last()).Tag = 
                orderItem.SalesOrderID;
    
            var productQuery = from orderDetail in db.SalesOrderDetail
                               join product in db.Product on 
                                   orderDetail.ProductID 
                               equals product.ProductID
                               where orderDetail.SalesOrderID == 
                                   orderItem.SalesOrderID
                               select new { product.Name };
    
            foreach (var productItem in productQuery)
            {
                ((RibbonMenu)menu1.Items.Last()).Items.Add
                    (new RibbonCheckBox());
                ((RibbonCheckBox)((RibbonMenu)menu1.Items.Last()).
                    Items.Last()).Label = productItem.Name;
                ((RibbonCheckBox)((RibbonMenu)menu1.Items.Last()).
                    Items.Last()).Click 
                    += new EventHandler<RibbonControlEventArgs>(checkBox_Click);
            }
    
        }
    }
    
  9. ソリューション エクスプローラで、リボン コード ファイルをダブルクリックします。

    リボン デザイナが開きます。

  10. リボン デザイナで [Customers] コンボ ボックスをダブルクリックします。

    リボン コード ファイルがコード エディタで開き、ComboBox1_TextChanged イベント ハンドラが表示されます。

  11. ComboBox1_TextChanged イベント ハンドラを次のコードで置き換えます。このコードは次のタスクを実行します。

    • PopulateSalesOrderInfo ヘルパー メソッドを呼び出す。このメソッドは、現在選択されている顧客の販売注文で [Products Purchased] メニューを更新します。

    • PopulateMailItem ヘルパー メソッドを呼び出す。このメソッドは、新しいメール メッセージの Microsoft.Office.Interop.Outlook.MailItem.ToMicrosoft.Office.Interop.Outlook.MailItem.SubjectMicrosoft.Office.Interop.Outlook.MailItem.Body の各フィールドにデータを追加します。

    Private Sub ComboBox1_TextChanged(ByVal sender As System.Object, _
        ByVal e As Microsoft.Office.Tools.Ribbon.RibbonControlEventArgs) _
            Handles ComboBox1.TextChanged
        PopulateSalesOrderInfo()
        PopulateMailItem(ComboBox1.Text)
    End Sub
    
    private void comboBox1_TextChanged(object sender, 
        RibbonControlEventArgs e)
    {
        PopulateSalesOrderInfo();
        PopulateMailItem(comboBox1.Text);
    }
    
  12. CustomerRibbon クラスに次のコードを追加します。このコードは、選択された製品の名前を新しいメール メッセージの Microsoft.Office.Interop.Outlook.MailItem.Body フィールドに追加します。

    Private Sub CheckBox_Click(ByVal sender As System.Object, _
        ByVal e As Microsoft.Office.Tools.Ribbon.RibbonControlEventArgs)
        Dim application As Outlook.Application = Globals.ThisAddIn.Application
        Dim inspector As Outlook.Inspector = application.ActiveInspector()
        Dim myMailItem As Outlook.MailItem = CType(inspector.CurrentItem,  _
            Outlook.MailItem)
        Dim myCheckBox As RibbonCheckBox = CType(sender, RibbonCheckBox)
        myMailItem.Subject = "Following up on your order"
        myMailItem.Body = myMailItem.Body + ControlChars.Lf + "* " _
            + myCheckBox.Label
    End Sub
    
    private void checkBox_Click(object sender, RibbonControlEventArgs e)
    {
        Outlook.Application application = Globals.ThisAddIn.Application;
        Outlook.Inspector inspector = application.ActiveInspector();
        Outlook.MailItem myMailItem = (Outlook.MailItem)inspector.CurrentItem;
        RibbonCheckBox myCheckBox = (RibbonCheckBox)sender;
        myMailItem.Subject = "Following up on your order";
        myMailItem.Body = myMailItem.Body + "\n" + "* " + myCheckBox.Label;
    }
    
  13. CustomerRibbon クラスに次のコードを追加します。このコードは次のタスクを実行します。

    • 新しいメール メッセージの Microsoft.Office.Interop.Outlook.MailItem.To 行に、現在選択されている顧客の電子メール アドレスを追加する。

    • 新しいメール メッセージの Microsoft.Office.Interop.Outlook.MailItem.Subject フィールドと Microsoft.Office.Interop.Outlook.MailItem.Body フィールドにテキストを追加する。

    Private Sub PopulateMailItem(ByVal addressToLine As String)
        Dim application As Outlook.Application = Globals.ThisAddIn.Application
        Dim inspector As Outlook.Inspector = application.ActiveInspector()
        Dim myMailItem As Outlook.MailItem = _
            CType(inspector.CurrentItem, Outlook.MailItem)
    
        myMailItem.To = ""
        Dim tempArray As [String]() = addressToLine.Split(New [Char]() {"|"c})
        myMailItem.To = tempArray(1) + "@example.com"
        myMailItem.Subject = "Following up on your order"
        myMailItem.Body = "Hello " + tempArray(1) + ","
        myMailItem.Body = myMailItem.Body + ControlChars.Lf + _
            "We would like to get your " + _
        "feedback on the following products that you recently ordered: "
    End Sub
    
    private void PopulateMailItem(string addressToLine)
    {
        Outlook.Application application = Globals.ThisAddIn.Application;
        Outlook.Inspector inspector = application.ActiveInspector();
        Outlook.MailItem myMailItem = (Outlook.MailItem)inspector.CurrentItem;
    
        myMailItem.To = "";
        String[] tempArray = addressToLine.Split(new Char[] { '|' });
        myMailItem.To = tempArray[1] + "@example.com";
        myMailItem.Subject = "Following up on your order";
        myMailItem.Body = "Hello " + tempArray[1] + ",";
        myMailItem.Body = myMailItem.Body + "\n" + 
            "We would like to get your " + 
                "feedback on the following products that you recently ordered: ";
    }
    

カスタム グループのコントロールのテスト

Outlook で新しいメールを開くと、リボンの [Messages] タブに [Customer Purchases] というカスタム グループが表示されます。

顧客へのフォローアップ電子メール メッセージを作成するには、顧客を選択し、その顧客が購入した製品を選択します。[Customer Purchases] グループ内のコントロールが実行時に AdventureWorks データベースから取得されたデータで更新されます。

カスタム グループのコントロールをテストするには

  1. F5 キーを押してプロジェクトを実行します。

    Outlook が起動します。

  2. Outlook で、[ファイル] メニューの [新規作成] をポイントし、[メール メッセージ] をクリックします。

    次の処理が実行されます。

    • 新しいメール メッセージ インスペクタ ウィンドウが表示されます。

    • リボンの [Messages] タブに含まれる [Clipboard] グループの前に [Customer Purchases] グループが表示されます。

    • そのグループ内の [Customers] コンボ ボックスが AdventureWorks データベースから取得された顧客の名前で更新されます。

  3. リボンの [Messages] タブの [Customer Purchases] グループで、[Customers] コンボ ボックスから顧客を選択します。

    次の処理が実行されます。

    • その顧客の個々の販売注文を表すメニューで [Products Purchased] メニューが更新されます。

    • 顧客が購入した製品を表すチェック ボックスで各販売注文メニューが更新されます。

    • 選択した顧客の電子メール アドレスがメール メッセージの [宛先] 行に追加され、メール メッセージの件名と本文にテキストが挿入されます。

  4. [Products Purchased] メニューをクリックし、いずれかの販売注文をポイントして、その販売注文に含まれる製品をクリックします。

    選択した製品の名前がメール メッセージの本文に追加されます。

次の手順

Office UI をカスタマイズする方法の詳細については、次のトピックで説明します。

参照

処理手順

方法 : リボンのカスタマイズの概要

チュートリアル : リボン デザイナを使用したカスタム タブの作成

方法 : リボンのタブ オーダーを変更する

方法 : 組み込みタブをカスタマイズする

方法 : Microsoft Office メニューをカスタマイズする

方法 : リボンをリボン デザイナからリボン XML にエクスポートする

方法 : アドインのユーザー インターフェイス エラーを表示する

概念

実行時のリボンへのアクセス

リボンの概要

リボン デザイナ

リボン オブジェクト モデルの概要

Outlook のリボンのカスタマイズ