Hello World Crashes.. I really need help with this... =S

R

Robin

Hello All,

After a long struggle I finally embraced C# in my Default language tool kit
and I am starting to enjoy its powers on Microsoft Windows Systems.. Its
great to Embed in Smart-phones or add missing functions in Windows Programs.
I think its way better then VBA in the first place.

Anyhow, after embracing C# I learned a lot about the language and I saw I
can make Plug-ins for Outlook as well. Now in the office they asked me to
write a Plug-in for outlook. I run as a Local Administrator on this system
but on the network (And thus on Exchange ( Not sure if that has anything to
do with this ) I am just a Normal user..)
Anyway, I tried to 'compile' this:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml.Linq;
using Outlook = Microsoft.Office.Interop.Outlook;
using Office = Microsoft.Office.Core;

namespace HelloWorldOutlook
{
public partial class ThisAddIn
{
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
MessageBox.Show("Startup");
}

private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
MessageBox.Show("Shutdown");
}

#region VSTO generated code

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup()
{
MessageBox.Show("Program Start");
this.Startup += new System.EventHandler(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
}

#endregion
}
}

But It didn't work.. since when I press Build & Deploy I get this as return.
An add-in could not be found or could not be loaded.
So I thought I am missing some File Copies. So I ran FileMon and I hoped
that would fix it. Well I was kinda wrong. It can find all the files (At
least that's what FileMon tells me) but I keep getting this error.

So, I wonder. Do I maybe have something wrong in the code?
Can somebody tell me were that I have my code errors? Or do I need an extra
tool to deploy this? (Visual Studio 2k8 // Outlook 2k7)

Next from that, how can I make a extra button on the tool bar?

Thanks in advance and keep coding ;)

Kind Regards,
Robin Vossen
 
K

Ken Slovak - [MVP - Outlook]

Do you have that VSTO addin set to set up the trust for the addin in the
Framework? VSTO addins require full trust to run, usually set up based on
strong naming your assembly and then setting full trust in CAS based on the
strong name for your assembly.

Have you reviewed the deployment guide for VSTO addins? Take a look at the 2
articles and make sure to closely follow all steps listed:
http://msdn.microsoft.com/en-us/library/bb332051.aspx
 
R

Robin

Yes I have installed everything.
And I figured out the problem.
My project was in the Reject list.
Since when I made a new one after installing the PIA it did work.
Anyway, thanks..

I am getting closer to being able to do this.
Though all the Samples / Tutorials / Documents talk about
Application.CommandBars.Add
I do not have access to this Function though..

Any ideas?

Thanks
 
K

Ken Slovak - [MVP - Outlook]

If you are referencing the Office PIA you should have CommandBars.Add(),
it's part of the object model.

Other applications have Application.CommandBars, for Outlook it's either
Explorer.CommandBars or Inspector.CommandBars.

In the case of Outlook 2007 you really want to use the ribbon for
Inspectors, not CommandBars. If you use CommandBars for an Inspector your UI
gets added to the AddIns tab along with the UI for any other application
that doesn't use the Inspector ribbon UI.
 
R

Robin

Thank you a lot for your help.
You gave me some terms I never heard of and I will do some research for
them. If my problems persist Ill ask again.
But thanks for all your great help.

Thanks again,

Robin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top