none
Make Microsoft Project active via OLE automation RRS feed

  • Question

  • Hello,

    I use MSP from my application via OLE. It works correctly. My code looks like that:

    FMSPAplikace := TProjectApplication.Create(Self);

    FMSPDokument := TProjectDocument.Create(Self);

    FMSPAplikace.Connect;

    FMSPAplikace.FileOpen(...);

    FMSPDokument.ConnectTo(FMSPAplikace.ActiveProject);

    FMSPAplikace.Visible := True;

    FMSPAplikace.Maximize;

     

    It works correctly in Windows XP. After this code MSP started and it is active application on the top. But there is problemin Windows 7. MSP started, but it only blink on main panel and active application is still my application. Is there any OLE command which can make MSP active project in Windows 7? I use MSP 2003. Thank you for any answer.

     

     

    Friday, December 10, 2010 9:35 AM

All replies

  • Hello,

    I use MSP from my application via OLE. It works correctly. My code looks like that:

    FMSPAplikace := TProjectApplication.Create(Self);

    FMSPDokument := TProjectDocument.Create(Self);

    FMSPAplikace.Connect;

    FMSPAplikace.FileOpen(...);

    FMSPDokument.ConnectTo(FMSPAplikace.ActiveProject);

    FMSPAplikace.Visible := True;

    FMSPAplikace.Maximize;

     

    It works correctly in Windows XP. After this code MSP started and it is active application on the top. But there is problemin Windows 7. MSP started, but it only blink on main panel and active application is still my application. Is there any OLE command which can make MSP active project in Windows 7? I use MSP 2003. Thank you for any answer.

     

     


    Been a while since I worked with 2003, but how does:

     

    FMSPAplikace.Activate

    work for you?


    Jack Dahlgren blogs at:
    Project and Retrovention
    and rarely Twitter
    Friday, December 10, 2010 8:11 PM
    Moderator
  • No :0/

    when I look in interface, there is no command named Activate. There are only:

    procedure ActivateMicrosoftApp(Index: PjMSApplication); dispid 5052;

    and

    function WindowActivate(WindowName: OleVariant; DialogID: OleVariant; TopPane: OleVariant): WordBool; dispid 705;

    but it looks that it is not what i am looking for.

    Tuesday, December 14, 2010 12:17 PM