Forum Discussion
Is there an alternative to Auto_Open for when MS Project lauches.
I confess, I did read your post when it first appeared. I didn't respond because you asked if there was anything besides the Auto_Open Even and wasn't aware of anything but then my range of knowledge is limited to VBA. I probably should have responded by saying there might be an API that could do what you want but you'd have to do some research for that.
I do recall a previous post on this forum that is related to what you are trying to do. I'm not sure if it will help but you could give it a read.
If I may ask, can you show us the code you have that installs the ribbon? And which formatting is getting whacked?
One more thought popped into my mind after posting this. Years ago when I was in a corporate environment I customized the Project Global to include a series of macros (via custom icons). I hoped corporate would allow us to instill that customization into what was then the "base Global" used by all Project users but they didn't buy it so I ended up distributing the custom Global to all Project users in our group. This is along the same line that Dale proposed in his updated suggestion. As he said, just a thought.
John
I won't actually provide all the code but here are key parts
I use the following to get to the CustomUI file
strFN=Environ("LocalAppData") & "\Microsoft\Office\MSProject.officeUI"
If the file does not exist then my code creates it.
I then treat this file as a simple text file, scan it to an appropriate place, and then insert my own xml code in for the new ribbons I'm adding such as
Print #intOutfile, "<mso:tab id=""MyTab"" label=""New Tab"">"
Print #intOutfile, "<mso:group id=""MyGroup"" label=""New Group"">"
Print #intOutfile, "<mso:control idQ=""mso:ChangeWorkingTime"" size=””small”” visible=""true""/>"
Print #intOutfile, "<mso:control idQ=""mso:TaskOutdent"" size=””small”” visible=""true""/>"
Print #intOutfile, "<mso:control idQ=""mso:TaskIndent"" size=””small”” visible=""true""/>"
Print #intOutfile, "</mso:group>"
Print #intOutfile, "</mso:tab>"
Between MS Project sessions it appeared that MS Project was rewriting the MSProject.officeUI file to add autoScale to the group and remove the size from the control such as
<mso:group id="MyGroup" label="New Group" autoScale="true">
<mso:control idQ="mso:TaskIndent" visible="true"/>"
Now this is where I need to apologise.
It has been some time since I last thought about this issue and I thought using an AutoExec style macro might help to rewrite the ribbon when MS Project starts. Hence the reason for my original post.
However, in the intervening time project has been patched a couple of times and it now appears that MS Project is not removing the formatting.
So I'm still curious as so methods of running code on starting MS Project (desktop version) but as far as the specific formatting problem I was having, that has been solved.
Thank you all for your assistance.
- John-projectAug 29, 2022Silver Contributor
Thanks for the update. I'm glad to hear the "overwrite" issue you were experiencing is apparently resolved but as far as other methods of running code, I can't help beyond what I already posted. I've never tried to edit XML for Project's ribbon UI so it is new territory for me also. Perhaps, but not likely, someone else with some expertise in that area will pop in.
John