Unable to use system commands to access folders for Outlook

Add-in Express™ Support Service
That's what is more important than anything else

Unable to use system commands to access folders for Outlook
 
Ryan Eiger




Posts: 14
Joined: 2009-01-25
Hello,

I have created an ItemsEventHandler and am having an issue within. I'm attempting to write something similar to the following code:

Dim objFolder As Outlook.MAPIFolder, objInbox As Outlook.MAPIFolder

    Dim objNS As Outlook.NameSpace, objItem As Outlook.MailItem

 

 

    Set objNS = Application.GetNamespace("MAPI")

    Set objInbox = objNS.GetDefaultFolder(olFolderInbox)


...but I get an error message, stating that "Name 'Application' is not declared". This is somewhat critical, because I need to have access to different folders. My whole intent with this project was to create an addon that detects when a message is deleted. The user is then prompted with a series of yes/no dialog boxes, allowing a copy of the message to be placed in different folders.

I think the issue stems from the fact that the event handler is abstracted and modularized from the "AddinModule.vb" file...right? How do I get around this?
Posted 25 Jan, 2009 22:21:09 Top
Ryan Eiger




Posts: 14
Joined: 2009-01-25
Update:

My theory was definitely correct. Adding similar code randomly into the AddinModule.vb file produces no errors. Given that I followed the supplied instructions on creating an ItemsEventHandler, how would I go about passing this object to the event handler?

Thanks.
Posted 25 Jan, 2009 23:07:02 Top
Ryan Eiger




Posts: 14
Joined: 2009-01-25
Oh, and I suppose I should also specify that the folders I wish to transfer messages to are non default folders. i.e. one will be "financial data", another will be "legal records", etc.
Posted 26 Jan, 2009 00:19:35 Top
Eugene Astafiev


Guest


Hello Ryan,

I have a bunch of questions for you:
1. What OS do you use? Is it up to date?
2. What Outlook version do you use? Is it up to date?
3. Could you send a sample add-in project which can reproduce the issue to the support e-mail address (see readme.txt)?
Posted 26 Jan, 2009 08:52:22 Top
Ryan Eiger




Posts: 14
Joined: 2009-01-25
Hello Eugene,

Thank you for the response. I emailed a copy of the exact program I'm working with to the included email address.

1) Windows Vista with SP1 and all available updates from Microsoft.
2) Outlook 2003 with all available updates.

By the way, I may not have been clear in my other messages. This is an issue with my knowledge of the software and its capabilities, not a bug. I'm sure there is a workable solution, I just am not yet familiar enough with the software to know what that is.

Thanks,
Ryan
Posted 26 Jan, 2009 10:58:54 Top
Ryan Eiger




Posts: 14
Joined: 2009-01-25
Oh, and I just ran into another random issue:

I'm attempting to publish what little I do have (with the offending code commented out) to show one of my partners today...but I keep getting this error message:

Please set the 'Assembly Company' in the AssemblyInfo file of the project.

...which is bizarre, because I've checked again and again, and that information is present. Is there some other place I need to look? I checked both the project properties assembly information tab, as well as the actual AssemblyInfo.vb file...
Posted 26 Jan, 2009 11:22:23 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ryan.

Did you rebuild the project before you run the Publish wizard?
Posted 26 Jan, 2009 11:38:44 Top
Ryan Eiger




Posts: 14
Joined: 2009-01-25
Wow, Sergey...thanks. That was a silly mistake. Hopefully the main issue is that easy to resolve. :D
Posted 26 Jan, 2009 11:48:28 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Good luck, Ryan.
Posted 26 Jan, 2009 11:50:09 Top