Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Mar 2005
    Location
    Kent, England
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Obtaining Application type (Vista/Office 2007)

    Hi, can anyone help?

    I am in the process of migrating an Office 2003 toolbar into the Office 2007 environment. I have created the ribbon within VB.Net and now need to show specific parts of the ribbon dependent on the application you have opened. Is there a way of identifying the name of the application that has opened. I have the below code in place:

    strApplication = application.GetType.FullName
    MsgBox(strApplication)

    When opening Word I receive "Microsoft.Office.Interop.Word.ApplicationClas s" in the message box, but in Excel and PowerPoint I see "System._ComObject". In all cases the ribbon loads as expected.

    Thanks
    Jack

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Obtaining Application type (Vista/Office 2007)

    In the Word object model, Application.Name returns "Microsoft Word". I think you should be able to get at this property, but the following doesn't mean a whole lot to me:
    <hr>Accessing the Object Model of the Host Application

    To access the object model of the host application, use the Application field of the ThisAddIn class. This field returns an object that represents the current instance of the host application. You can access this field by using Me.Application (in Visual Basic) or this.Application (in C#) in the ThisAddIn class. Code that is outside the ThisAddIn class can access this field by using Globals.ThisAddIn.Application.<hr>
    See: Getting Started Programming Application-Level Add-ins on MSDN.

  3. #3
    2 Star Lounger
    Join Date
    Mar 2005
    Location
    Kent, England
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Obtaining Application type (Vista/Office 2007)

    Thanks for your help. Unfortunately the only option I have that closely relates to "Application" is "ApplicationOjbect" which gives me the options I have already tried to use without success. It seems such a simple piece of information to obtain but after posting on two sites have really had no joy.

    So frustrating when it appears so logical !!

    Cheers
    Jack

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •