473,770 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do you determine item type in a folder in vb.net?

I am trying to process all folders in a "sent items" folder in outlook 2000.
Most items are of "mail Item" type, but some are of an appointment item type.

I've looked through the newsgroups, and I've also looked through Slipstick,
and Sue's book. Most of that is geared towards VB 6 it seems.

Here is the code snippet

Sent_Folder = objNS.GetDefaul tFolder
Outlook.OlDefau ltFolders.olFol derSentMail)
objItems = Sent_Folder.Ite ms
curmsg = 1
folder_count = objItems.Count
While loop_continue
obj = objItems.Item(c urmsg) 'OBJ IS DEFINED AN OBJECT
If obj.typename() <> "MailItem" Then
curmsg += 1 'BASICALLLY IGNORE IT CONTINUE WITH THE NEXT
ITEM
Else
msg = objItems.Item(c urmsg)
If msg.SentOnBehal fOfName = "SPECIFIC PERSON" Then
msg.Move(SPECIF IC_folder)
objItems = Sent_Folder.Ite ms
folder_count = objItems.Count
Else
curmsg += 1
End If
End If
If curmsg > loop_continue Then
loop_continue = False
End If
End While

In Sue's book it talks about using typename() or Class, but neither are
available using vb.net.

When I type the following objItems.Item(c urmsg).
Then intellisense only gives me one option which is GETYPE(), but that
doesn't return what type of item it is.

Any help you could provide would be most appreicated.

jf
Jul 21 '05 #1
0 1101

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
2889
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code that applies to all these events, but I need to have specific code execute when the form closes. The properties for this method are sender (the originator) and e (event arguments). I know how to get typeof (sender) to determine what form or...
3
1915
by: Web Webon | last post by:
Hi everybody! I wonder if this is possible? I need to determine if a client is using "windows classic folders" or anything else. If I instantiate a Shell ActiveX object is there a way of obtaining this information from javascript? (I know that the user will get prompted about allowing such an operation, but I am willing to live with this). Because of the way one of my pages work, I need to know this information in order to "cover up"...
4
3765
by: Marcel Stör | last post by:
Hi folks Does anyone know how to add an object of type ContactItem to an _Items list? _Items provides an add() method which, however, only accepts a Variant as parameter... Here's what I do: - logon to Exchange - find default folder (public folder) - navigate to the specific folder (contains contacts) - as the MAPIFolder object for items -> _Items
2
3182
by: Daniel Walzenbach | last post by:
Hi, I created an ASP.NET Datagrid where a single row can be selected by clicking anywhere on the row (according to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchTopQuestionsAboutASPNETDataGridServerControl.asp, Selecting Rows by Clicking Anywhere). Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, _ ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) _
7
1449
by: Guido Rooms | last post by:
Hello All, I'd like to keep some files (modules) which are to be used in many projects/solutions in a separate folder, not belonging to any project or solution, such that I can add (link) them to any project with "Add Existing Item". The problem is that when I try to create such a file with "Add New Item", the new file is always saved in the current project folder and that there seems to be no option available to save it elsewhere...
4
2457
by: John A. Bailo | last post by:
After upgrading from Outlook 2000 to the 2003 object model, some of my Outlook automation code no longer functions. For example, in 2000, I used to be able to loop through a list of .Items in a folder and refer to each as .Item(n) Say for example, my folder contained MailItem and PostItem -- I could treat each differently by casting .Item(n) differently.
5
1830
by: yancheng.cheok | last post by:
hello, may i know how i can determine whether a pointer is pointing to an array or a single item during runtime? this is because in certain situation, i need to determine whether to use delete or delete to deallocate the item(s) ponting by the pointer. also, is there any way to determine whether the allocated memory pointed by the pointer is allocated through new or c version calloc/ malloc?
1
2563
by: topramen | last post by:
does any one here know of a good way to to determine whether or not a given path is a directory (e.g., "c:\mydir") or a file (e.g., "c:\mydir \myfile.txt")? i started attacking this problem by using filesystemobject to check whether or not a directory existed for the path. if so, it was a directory path. if not, i checked to see if a file existed for it. if so, it was a file path. this code is shown below: ...
3
8990
by: ommail | last post by:
I have two RichTextBox controls on a form, and single ContextMenuStrip control which serves for both textboxes. I need to determine which RichTextBox control invokes an event handler in ContextMenuStrip. So I use that code: private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
0
9618
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.