ActivateMicrosoftApp

Microsoft アプリケーションをアクティブにします。

構文
Application.ActivateMicrosoftApp( Index )
引数
Index (XlMSApplication必須
アクティブにするMicrosoftアプリケーションを指定
戻り値

定数一覧

XlMSApplication 列挙

名前説明
xlMicrosoftWord1Microsoft Office Word
xlMicrosoftPowerPoint2Microsoft Office PowerPoint
xlMicrosoftMail3Microsoft Office Outlook
xlMicrosoftAccess4Microsoft Office Access
xlMicrosoftFoxPro5Microsoft FoxPro
xlMicrosoftProject6Microsoft Office
xlMicrosoftSchedulePlus7Microsoft Schedule Plus
CONST xlMicrosoftWord = 1
CONST xlMicrosoftPowerPoint = 2
CONST xlMicrosoftMail = 3
CONST xlMicrosoftAccess = 4
CONST xlMicrosoftFoxPro = 5
CONST xlMicrosoftProject = 6
CONST xlMicrosoftSchedulePlus = 7

プログラム実行例

PowerPointを起動する(Excel)

CONST xlMicrosoftPowerPoint = 2

DIM Excel = CREATEOLEOBJ("Excel.Application")
Excel.Visible = TRUE

Excel.Application.ActivateMicrosoftApp(xlMicrosoftPowerPoint)

DIM ID = GETID("PowerPoint", "PPTFrameClass")
SLEEP(5.000)

CTRLWIN(ID, CLOSE)
Excel.Quit
  1. CREATEOLEOBJ
  2. Excel.Application.Visible
  3. Excel.Application.ActivateMicrosoftApp
  4. GETID
  5. SLEEP
  6. CTRLWIN
  7. Excel.Application.Quit

Outlookを起動する(Excel)

CONST xlMicrosoftMail = 3

DIM Excel = CREATEOLEOBJ("Excel.Application")
Excel.Visible = TRUE

Excel.Application.ActivateMicrosoftApp(xlMicrosoftMail)

DIM ID = GETID("Outlook", "rctrl_renwnd32")
SLEEP(5.000)

CTRLWIN(ID, CLOSE)
Excel.Quit
  1. CREATEOLEOBJ
  2. Excel.Application.Visible
  3. Excel.Application.ActivateMicrosoftApp
  4. GETID
  5. SLEEP
  6. CTRLWIN
  7. Excel.Application.Quit

Wordを起動する(Excel)

CONST xlMicrosoftWord = 1

DIM Excel = CREATEOLEOBJ("Excel.Application")
Excel.Visible = TRUE

// Wordを起動
Excel.Application.ActivateMicrosoftApp(xlMicrosoftWord)

DIM ID = GETID("Microsoft Word", "OpusApp")
SLEEP(5.000)

// Wordを閉じる
CTRLWIN(ID, CLOSE)
Excel.Quit
  1. CREATEOLEOBJ
  2. Excel.Application.Visible
  3. Excel.Application.ActivateMicrosoftApp
  4. GETID
  5. SLEEP
  6. CTRLWIN
  7. Excel.Application.Quit