web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to define desktop ...
Power Automate
Answered

How to define desktop automation against fore ground window?

(0) ShareShare
ReportReport
Posted on by 14

Hi, I have a quesion for defining flows.

I'd like to past image against any foreground office (word, excel, powerpoint) window.

When I define 'Get window' element, it create new variable 'AutomationWindow'.

But other desktop UI control elements cannot use it.

How could I define to select Tab, Menu, or other operations against6foreground window?

I have the same question (0)
  • fraenK Profile Picture
    2,125 on at

    Is there an error message? Getting a window has to happen through a unique selector, so if there are multiple matching windows, it will fail.

  • Orion_Solo Profile Picture
    14 on at

    FraenK, thanks for your response.

    Sorry, I have no errors. My question is very simple.

    I'd like to paste an image to  'AutomationWindow'.

    I think I need to get Tab of 'AutomationWindow' by 'UI automation -> Select Tab on window' action.

    But I don't know to connect this action with 'AutomationWindow'.

  • fraenK Profile Picture
    2,125 on at
  • Orion_Solo Profile Picture
    14 on at

    Sorry for taking up your time.

    But I think this is a specified window operation. I can get same operation manually or by recording.

    I'd like to operate to the menu of the pre-opened unspecified window. It's depending on the time and situation. For example, It is a word document that has title 'foo' or 'bar' or etc.

    I thought the window will be 'foreground window', so I used 'Get window' element with the setting 'foreground'. But I don't know the right way to realize it.

  • fraenK Profile Picture
    2,125 on at

    Get window has a foreground window selector https://docs.microsoft.com/en-us/power-automate/desktop-flows/actions-reference/uiautomation#getwindowbase

  • Orion_Solo Profile Picture
    14 on at

    Yes. The action generate two variables as 'AutomationWindow' and 'WindowTitle'.

    I'd like to know how to use the variables to next action, for example 'Select tab in window'.

    https://docs.microsoft.com/en-us/power-automate/desktop-flows/actions-reference/uiautomation#selecttab

     

  • Verified answer
    fraenK Profile Picture
    2,125 on at

    Select tab works based on a tab group UI selector, where you could include your WindowTitle variable

  • burque505 Profile Picture
    398 on at

    Hi @Orion_Solo, just going from the previous posts it looks like you're having issues with Word automation. Without screenshots or really detailed descriptions of what you're wanting to accomplish it's tough to figure out where your issues are, exactly. Just as a quick-and-dirty attempt to point you in the right direction,  here's a little demo.

    1. I have previously created a document with one line of text in it. I'll use that as a guinea pig.
    2. I start Word, passing a file path to the document created. This could of course be dynamic depending on your needs.
    3. (I set a dummy file path in case I want to save the file later. I haven't done that - it's left as an exercise)
    4. I click the 'Insert' option on the Word ribbon (I don't think it qualifies as a tab, but maybe).
    5. I'll send keys to Word to position the cursor where I want to insert a picture.
    6. I click the 'Pictures' item on the ribbon.
    7. Using a combination of 'Send keys' and variable, I select and insert the picture.

     

    Below is a teaser animation for incentive. 😀 (You may have to click on the file name. It shows up animated in my preview, but for me not on the forum post itself.)

     

    word_automation.gif

     

    Here are some pics of the flow:

    flow1.png

    flow2.png

    If that's not enough info, please let me know.

     

    Regards,

    burque505

  • Orion_Solo Profile Picture
    14 on at

    Thanks much. I understand selector barely.. But.. what a terrible interface this is.

     

    This is summary about the operation.

    HOW TO the variables to next action

    1. drop in "get window" action with "foreground"
    2. open temporary word document.
    3. record tab clicking (and more operations) on the document and stop. It just add 'Select tab in window' action for the temporary doc.
    4. show UI elements list by right side icon.
    5. double click window UI selector that named the temporary doc title. then the selector panel is opened.
    6. double click specified line. then open the selector builder panel.
    7. click the value area of attribute "Name" and change value to %WindowTitle%.
    8. click 'Update' button. then the builder panel is closed.
    9. close selector panel.
    10. but the selector name remains as the temporary doc title. why! this is the label of selector itself.
    11. push F2 and can freely change the name. for example 'destination window'.
    12. shoud be finish all....
    13. but not good. No.7 seems to be something wrong... this flow can run, if  "Process" attr only except "Name" attr.
  • Orion_Solo Profile Picture
    14 on at

    Thanks for your detailed advice. This is useful for me.

    I've wanted to paste a image to any doc as PNG format.

    And I've not see the selector function.

     

    And.. my PAD is a full localized edition. so the most people wouldn't be able to read the screen shot.

    Sorry for my poor English.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 922

#2
Valantis Profile Picture

Valantis 837

#3
Haque Profile Picture

Haque 534

Last 30 days Overall leaderboard