How to CHANGE ICON in application windows for Word 2010 and PowerPoint 2010?

I have an excel PROJECT that creates word and powerPoint files, by copying a respective word or PowerPoint MASTER file, to create new file names, into which content relating to the PROJECT can be entered.

When the new PowerPoint or Word file is OPEN, I want to show that it belongs to the PROJECT, by changing the ICON displayed at the top left of the respective Word or PowerPoint application window. (I stress I DONT want to change the FILE ICON that is visible in file directories, only the icon of the main window of the open file.)

Though I have done this via vba for excel, I dont know how to change application window icons for a PowerPoint or Word file.
As the icon changes are one-off to the application windows of the master files, I dont require a programmatic solution, but would be happy to use one in VBA.

Please can you help me?

Thanks, Kelvin
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ankit PareekOnline MarketingCommented:
Hey icon for each application you can change manually by right click on application and proceed to settings for more and detailed understand about answer refer to below link
You don't say HOW you changed the Excel top left icon but I'm guessing you used APIs in the WorkBook Open event?

If so the code will work in PowerPoint (and probably Word) but it must be as the document opens which is much harder to achieve in PowerPoint. See if this example does what you need.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Kelvin4Author Commented:
Thanks for the quick and complete response. You were right - apols - I did use APIs in the WorkBook Open event.

Your solution worked at the first attempt, for both MS Word and PowerPoint, but it took me time to create icons to distinguish the various excel, word and powerpoint files within my project.

The new icons are now visible in the respective application windows, and also in the file tumbnail images actuated by pointing the cursor at the respective open file in the Windows task bar.

Kelvin4Author Commented:
@JRSWilson's solution is quite correct for setting the window icon of a Word Application that is opened from an existing .docm file.

However, I needed to create the word file (from a Master file) via this sort of automation and then set its window icon:

    Set wdApp = New Word.Application    
    wdApp.Visible = True
    'string activeWdHelpFile is the  Filename of the new file to be made (from Master)
    activeWdHelpFile = "help_uc.docm"
    strWdName = rootPath & "cFolder_Client_InPrep_List\" & activeWdHelpFile

    'set (closed) Master file from which new file is to be copied
    wd_docm_Master = "D:\folders\docm_Master__v1.docm"

    'copy (closed) master to new name & new file
    FileCopy wd_docm_Master, strWdName
    wdApp.Documents.Open FileName:=strWdName
    Set activeDoc = wdApp.ActiveDocument

    ... then setNewIcon ....

FOR setNewIcon TO WORK IMMEDIATELY the Word doc is created automatically, it was essential to activate wdApp, as show by the <<<''''''' line above.
[Alternatively, add a message box at ANY stage before the New icon is set, (even as early as in theThisDocument_Open event).]

However, once the new doc has been made automatically and saved, the new icon will automatically display, (a) because as @JRSWilson says, you call it from the OpenDoc event, and (b) opening the file by clicking activates it automatically.

I hope this helps someone, sometime!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.