Hey!!! Do not forget to “Include” me… Ok?
I am not talking about some Friday night dinner or the latest buff around the corner. I am talking about the “Include” tab on Outlook 2007’s Ribbon UI.
Recently I got this case where customer developed a custom email form but he was not able to use the “Include” tab to add attachments to the email, as you can see from the following screenshot.
All the buttons were grayed-out, but why? Customer had no clue, well that’s why he called Microsoft, isn’t it?
I tried to reproduce it locally, but first I opened up the custom form which customer was using and the initial discovery was that there was no message body included to it. That ring some bells to me, but I ignored that for the moment and tried to dig if there is any property that I can set to disable that Include tab but there were none. I also checked if there was any code behind, but there was none.
Now that I know what was present in form, and what was not, I decided to start from scratch and created a new form. And discovered the following.
The issue here is that the customer has deleted the standard “Message” field (which is used to write the email content) from the message, this field is also used to insert attachments, business cards, calendar & other stuff by Outlook.
Repro Steps
1) Open a new email inspector
2) Go to Developers Tab
3) Hit Design Mode
4) Delete the Message body
5) Run the Form and you will see the “Include” as grayed out.
Good now we know that was the culprit, but I do not need that message body on my form.. how do I fix it?
Workaround
1) We need to add the Message Body back to the form
2) Open the form in Design Mode again and drag & drop the “Message” back to the form
3) Now you might not want that “Message Body” to be visible, but if you set the “Message Body” visible state
to false then you will again not be able to add attachments as the body is not visible.
4) Another workaround, you need to keep the visible state as visible but make body’s height & width set to 0 to hide it from screen
Bingo!! That was it.. yeah now it works.
..but what a minute..why?
Overall, that's a general design decision they made a long time ago. That first page of the message form has a lot of dependencies on commands, etc. So once you do a "simple" thing like delete the body control, you run some big risks. It's up to the form developer to really scope all of that out, disable other commands if they need to, etc.
Happy Debugging!!!