Re: C# Object parameters in Outlook and Office methods
From: Sunny (sunny_at_newsgroups.nospam)
Date: 09/30/04
- Next message: Fergus Deffely: "Disabling Calendar deletes"
- Previous message: Sunny: "Re: ActiveSync, addins and UI"
- Next in thread: Michael: "Re: C# Object parameters in Outlook and Office methods"
- Reply: Michael: "Re: C# Object parameters in Outlook and Office methods"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 30 Sep 2004 09:34:01 -0500
Hi,
passing a strings to GetItemFromID works for me. But there were some
other methods where it didn't work. SO I have done:
string mystring = "blabla";
object par = mystring;
and pass par to the function.
Hope that helps
Sunny
In article <#a206fmpEHA.3244@tk2msftngp13.phx.gbl>,
outlookissueman@hotmail.com says...
> I am writing an Outlook COM Add-in in C# (Visual Studio .NET 2003). I am
> having trouble with methods in the Outlook Object Model that have Object
> parameters. These seem to be Variant parameters (whatever they are) in
> Visual Basic, and I do not have VB experience. I can't seem to use any of
> the methods with Object parameters successfully, since I am apparently not
> passing in the proper data.
>
> The latest one is GetItemFromID, which has the following signature (from the
> Object Browser in Visual Studio):
>
> public abstract new System.Object GetItemFromID ( System.String EntryIDItem
> , System.Object EntryIDStore )
>
> I try to pass in two strings containing the EntryID of the item and store
> (the folder's StoreID), and I get the following error:
>
> System.Runtime.InteropServices.COMException (0x92840107): Could not open the
> item. Try again.
>
> Passing in System.Reflection.Missing.Value for the StoreID (since it is
> listed as an Optional parameter in VBAOL11.CHM) made no difference. The two
> strings looked correct in the debugger... the ItemID is a long hex-looking
> string, and the StoreID is a much longer one.
>
> I've had similar trouble with the Temporary parameter in the Add method of
> the CommandBars object (in Microsoft.Office.Core). I've passed in the C#
> keyword "true" as a parameter which seems to work on my system, but not on
> other systems where I installed my program:
>
> public abstract new Microsoft.Office.Core.CommandBar Add ( System.Object
> Name , System.Object Position , System.Object MenuBar , System.Object
> Temporary )
>
> I am referencing the Outlook XP PIAs directly (by browsing to the DLLs), if
> that makes a difference. Am I supposed to be doing something different with
> these Variant parameters from C#?
>
> Michael
>
>
>
- Next message: Fergus Deffely: "Disabling Calendar deletes"
- Previous message: Sunny: "Re: ActiveSync, addins and UI"
- Next in thread: Michael: "Re: C# Object parameters in Outlook and Office methods"
- Reply: Michael: "Re: C# Object parameters in Outlook and Office methods"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|