I have an Outlook AddIn, which has custom form regions with message class name IPM.Note.XXX (for MailItem related Form Regions) as well as IPM.Appointment.XXX (for AppointmentItem related Form Regions), where XXX varies for different form regions. In a particular issue observed however, it is observed that, on the double click of date in a calendar or on click of a "New Appointment" menu option in the ribbon, my custom form region with IPM.Appointment.XXX is invoked. This is not the intended behavior and no code has been written for such thing to happen. Also, I have checked the registry entries, and those seem to be fine. So can you please let me know, what might be causing this issue?
Thanks,
Bhushan.
Related
I've got a minimal VSTO Addin for Outlook 2010 with a ribbon. My only goal is to display a ribbon (created via designer) with no functionality. From what little I can tell from MSDN ribbons should just automatically be displayed by default, perhaps with tweaking ControlIdType/CustomId properties for tabs.
Alas, tweaking these properties does nothing -- Outlook loads and displays no tab. A simple message box displayed in the ribbon loader reveals it never is triggered. Additionally, I haven't seen any information resources (tutorials, walkthroughs, overviews, etc..) that say anything about needing to manually tell Outlook to display tabs.
How do I get the tabs displayed?
Is there a good resource other than MSDN that's good for VSTO newbies?
To get your ribbon displayed, on the base ribbon in your code change the RibbonType property to be Microsoft.Outlook.Explorer.
What fixed it for me (without starting a new project), in the Ribbon1.vb ribbon design, I clicked on the the Ribbon1 name above the ribbons 'File' button, in the properties pane, clicked on tabs (collection), under the heading 'Design' I changed the name (from Tab1) to something else.
Clicked ok, tested by clicking F5 and it worked. Hope this helps someone else.
I would like to display a custom tab on ribbons of three types of Outlook windows:
main window (Microsoft.Outlook.Explorer)
new message window (Microsoft.Outlook.Mail.Compose), and
read existing mail window (Microsoft.Outlook.Mail.Read)
I am specifying (in that order) comma-separated list of namespaces in the RibbonType property, as:
this.RibbonType = "Microsoft.Outlook.Explorer, Microsoft.Outlook.Mail.Compose, Microsoft.Outlook.Mail.Read";
However, the custom tab ONLY appears in the new mail window (Microsoft.Outlook.Mail.Compose), and does not appear in the other two window types.
I cannot figure out why. Anyone solved this before?
How can I debug, diagnose the issue? This is all Office+VSTO internals, I don't have anywhere to put a breakpoint.
I have just created a new sample Outlook add-in and set the RibbonType property as shown above. Viola! I can see a custom markup in all cases.
Most probably you get an UI error. Make sure that the Show add-in user interface errors checkbox is selected in the Outlook settings. See How to: Show Add-in User Interface Errors for more information.
I'm developing an Outlook 2010 addin in Visual Studio 2010.
I have created a custom Form Region that is going to implement the messageClass called:
IPM.Note.Archivado
This class is going to be assigned to processed messages by an application using exchange
web services that will run nightly. This is tested and working ok. When the Form Region
is loading I can recover the:
message.MessageClass as "IPM.Note.Archivado"
Ok, What I need now, It's to assign a different inbox icon to the messages that matches
that messageClass, so I used the property panel in the custom Region Form and selected
icons for read, forwared, default, actions without problem.
I can achieve this if I choose the FormRegionType as replacement or Replace-ALL in the
manifest, but what I need is this form windows to be AdJoining.
When the formRegionType is adjoining I can not get the assigned icons to load in the
inbox panel.
I have been reading a lot of documentation but I can't find the solution to my problem.
Here it's form Region definition:
[Microsoft.Office.Tools.Outlook.FormRegionMessageClass(Microsoft.Office.Tools.Outlook.FormRegionMessageClassAttribute.Note)]
[Microsoft.Office.Tools.Outlook.FormRegionMessageClass("IPM.Note.Archivado")]
[Microsoft.Office.Tools.Outlook.FormRegionName("hnaOutlookAddin.FormRegionMessageClassArchivado")]
public partial class FormRegionMessageClassArchivadoFactory
{
}
For custom Outlook icons - you must use a replacement form region. If you need an adjoining form region - you need to create another class. You can have multiple form regions targeting the same message class. I've used both replacement and adjoining form regions for IPM.Note.XXXX.
I have created an Outlook Add-In that adds a button to the ribbon of a new email window, but it's causing a problem.
Here is what happens:
User has Outlook Open.
User opens Excel.
User sends excel document to someone via File->Save and Send->Send as Attachment
User makes a change to the document
User attempts to close the document
This is when Outlook prompts the user to save the file, but the dialog box is hidden behind the Excel window and the user can't get to it without doing some shenanigans.
My Outlook Add-in does many other things, but I've pinned it down to the Ribbon.cs file I created to add a button to the new email window. When I change the RibbonType property of the OfficeRibbon object from Micorosft.Outlook.Mail.Compose to nothing, the Save Dialog shows as it should. When I change it back to "Compose", it hides the dialog box again.
Does anyone know of any way around this? I have confirmed this happens when the project is either an Outlook 2007 Add-In or an Outlook 2010 Add-In.
Thanks in advance.
So in reference to the link sent by user1217053 the answer would probably be along the lines of...
create a class scope field for the Outlook.Mailitem
have it bind to the BeforeClose event.
Inside the BeforeClose event handler for this field, add code such as ...
cMailItem_BeforeClose(bool Cancel)
{
var Insp = cMailItem.GetInspector();
Insp.Close();
Marshal.FinalReleaseCOMObject(Insp);
Insp = null;
}
Then hopefully this will get rid of the shadow inspector.
I dont know if you are still working on with this problem or not, but I faced the exact same problem and then found the solution. You must be using the Ribbon designer just like I was. The ribbon designer cause this problem. I had to change from Ribbon designer to Ribbon XML. It was a little bit of work to remove code and change some logic, but that fixed the problem. I heard the other altenative is to use a wrapper class.
Hope this helps.
I am new to VSTO programming. I have created a basic addin for Outlook 2007 that monitors a folder containing XML text files which it opens and then sends them as an email, then deletes them. this all works fine.
I want the user to be able to configure certain settings for the way the addin/program will operate, such as the folder that it will monitor, and other things. The logical way to do this is to create a menu item in the addin (which I have also done) that opens a windows form (or XAML window) that allows them to enter the parameters.
In my addin I added a new item Windows Form, which worked, and the designer opened. However, in my addin code I cannot open the form. The Show() method normally associated with form objects is not available.
Is this simply something you cannot do, or am I just doing it the wrong way?
I have read about Outlook form regions, but these seemed to be attached to outlook items such as a new email, task, appointment etc... there doesnt seem to be a way to create a form region that can be opened in the main window of Outlook.
Ideally, I would like to go with my original method of opening a new window from a menu item, but if this isnt possible I would like to hear other solutions.
Thanks,
Will.
For a normal form, it sounds like you didn't just add System.Windows.Forms as a reference,
create the object then show it eg.
Form myFrm = new frmFlightList();
myFrm.Show();
This should work in a VSTO addin, as it does in any other form. The CMSConnectorControl object you refer to is a distraction to others for the general case of just wanting to display a form.
figured this out, After I built my form I just had to add these lines
CMSConnectorControl formMain = new CMSConnectorControl();
formMain.ShowDialog();
to the ThisAddin_Startup() function.