Roger
asked on
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
Thanks
Kelvin
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.
Thanks
Kelvin
ASKER
Postscript!
@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
<<<<<''''''''''''''''''''' '''''''wdA pp.Activat e''''''''' '''''''''' ''''''''
'string activeWdHelpFile is the Filename of the new file to be made (from Master)
activeWdHelpFile = "help_uc.docm"
strWdName = rootPath & "cFolder_Client_InPrep_Lis t\" & activeWdHelpFile
'set (closed) Master file from which new file is to be copied
wd_docm_Master = "D:\folders\docm_Master__v 1.docm"
'copy (closed) master to new name & new file
FileCopy wd_docm_Master, strWdName
wdApp.Documents.Open FileName:=strWdName
Set activeDoc = wdApp.ActiveDocument
activeDoc.Save
... 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!
Kelvin
@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_Lis
'set (closed) Master file from which new file is to be copied
wd_docm_Master = "D:\folders\docm_Master__v
'copy (closed) master to new name & new file
FileCopy wd_docm_Master, strWdName
wdApp.Documents.Open FileName:=strWdName
Set activeDoc = wdApp.ActiveDocument
activeDoc.Save
... 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!
Kelvin
superuser.com/questions/56