Welcome to MSDN Blogs Sign in | Join | Help

Le Café Central de DeVa

DeVa's Developer Messaging blog!!

News

  • <font color="WHITE">Le Café Central de DeVa</font> DeVa rocks!!

    My XBOX Live

    XBox Live

    Disclaimer:
    This weblog/blog is solely my opinion.The information in this weblog/blog is provided "AS IS" with no warranties, and confers no rights. This weblog/blog does not represent the thoughts, intentions, plans or strategies of my employer. Inappropriate comments will be deleted at the authors discretion.

    Use of included script samples are subject to the terms specified in the Terms of Use
    .

    Privacy Statement:
    I do not collect personal data associated with comments posted to this site.


    Translate into your language

    Site Statistics
    Locations of visitors to this page






    Make a difference


    Subscription offer


    Developer resources



    Students free software

    Try & Test Drive Online

    More about Windows 7
    Download
    Virtual Roundtable with Mark Add to Calendar

    Experiences

    Go Green!!



Outlook Programming : How to get the File Menu commands programmatically?

This time we will try using the Outlook Object model, we can able to get the Outlook File Menu commands programmatically (I tried with Outlook 10)

   1:          ...
   2:          ' First get the ActiveExplorer
   3:          Dim oExp As Outlook.Explorer = oApp.ActiveExplorer()
   4:   
   5:          ' Then get the menu bar.
   6:          Dim oCmdBars As Office._CommandBars = oExp.CommandBars
   7:          Dim oCmdBar As Office.CommandBar = oCmdBars("Menu Bar")
   8:          'If needed display the CommandBar Name 
   9:          Console.WriteLine(oCmdBar.Name)
  10:   
  11:          ' Get the controls 
  12:          Dim oBrCrls As Office.CommandBarControls = oCmdBar.Controls
  13:   
  14:         ' Then get the File menu.
  15:          Dim oBPop As Office.CommandBarPopup = oBrCrls("File")
  16:         ' If needed display the caption
  17:          Console.WriteLine(oBPop.Caption)
  18:          oBrCrls = oBPop.Controls
  19:   
  20:          ' Then loop each menu & display the caption
  21:          Dim oBtn As Office.CommandBarControl
  22:          For Each oBtn In oBrCrls
  23:              Console.WriteLine(oBtn.Caption)
  24:          Next
  25:          ....

Comments

No Comments

New Comments to this post are disabled
Page view tracker