MSDN > フォーラム ホーム > Visual Studio Tools for Office > Can Activate word window from?
質問する質問する
 

質問Can Activate word window from?

  • 2009年7月4日 13:37Manian.NET ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    Hi,

    Kindly go thru the belwo scenario:

    1. Have word 2007 document with Content Controls.
    2. Showing an User control OnContentControl_Enter event.
    3. Closing the User control on user control's DeActivate event.

    Here I am trying to Activate/SetFocus the Word Window.

    Whats happening: when I click on the document the User control got closed and the focus not into the word document. The document got the focus on the second click.

    If possible, kindly provide a solution else give me the reason of this behavior.

    Thanks,
    Manian.NET

すべての返信

  • 2009年7月6日 4:25Vineeth Paliath ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    Hi,

    Try calling the Activate method available Word.Application.Activate();



    Vineeth
  • 2009年7月9日 2:17Manian.NET ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    Hi Vineeth,

    Thanks for looking into this!

    I have used below things.

    Word.Application.Activate();
    Word.Application.ActiveWindow.SetFocus();

    and many other possiblities related to Word Window activation and SetFocus, none of the things helping me....


    Can I get any other Suggestions from any others for this problem????????

    Thanks,
    Manian.NET
  • 2009年7月9日 8:32Mike WalkerMVP, モデレータユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    The inner window is ActiveDocument.Activate() as you are allready in Word the Application.Activate will only fire if not the primary window.

    Regards
    Mike Walker MVP - Visual Developer VSTO - Please mark the best replies as Answers !
  • 2009年7月11日 14:33Manian.NET ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    Hi Mike,

    I tried the following:

    ActiveWindow.Activate();
    ActiveWindow.SetFocus();

    But no use...


    There is no ActiveDocument.Activate()  as such as...


    any other solution???