473,398 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Convert VBA COM to C# COM interop (Outllook 2k)

I am converting an Access 2k SQL Project to a WinForms
C# .Net solution. The last technical hurdle in this
exercise is to replace the integration with Outlook 2000.
(Upgrading Outlook is not a solution!)

In the VBA system, a note facility exists which allows the
user to associate a note with (almost)any business entity
in the database. The note can be just text or it can be a
replication of an email generated in Outlook! In the case
of the later, the user selects an email address and an
entity descriptor subject from respective comboboxes and
clicks a button. The button click event instantiates
Outlook and displays a New Mail document with the selected
email address and entity descriptor Subject pre-set. (The
Subject has a prefix which is used to identify and
associate subsequent replies, as described below!) When
the user completes and sends the email, the body text is
captured via the "WithEvents" linkage and is added to the
database.

Additionally, whenever new mail is received by Outlook,
the WithEvents linkage intercepts the item and examines
the Subject looking for a note identifier(mentioned
above). If found, the essence of the email (sender, body,
date received) is saved and associated with the
originating note in the form of a conversation thread.
(This thread can be extended ad infinitum.)

Also, on Startup, the VBA system examines the user's
Outlook Inbox looking for any unprocessed reply messages
and integrates them into the database as above.

My challenge is to replicate this process in the C# .Net
solution!
Nov 15 '05 #1
4 2345
Eric,

This should be rather easy. You can create COM Add-Ins for Outlook (or
any Office app really), and then distribute that to every machine. I
believe there is a project template in the Enterprise Edition of VS.NET for
an Office Add-In which you can use which will set up all of the plumbing.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Eric Chinn" <gs**@rogers.com> wrote in message
news:1a****************************@phx.gbl...
I am converting an Access 2k SQL Project to a WinForms
C# .Net solution. The last technical hurdle in this
exercise is to replace the integration with Outlook 2000.
(Upgrading Outlook is not a solution!)

In the VBA system, a note facility exists which allows the
user to associate a note with (almost)any business entity
in the database. The note can be just text or it can be a
replication of an email generated in Outlook! In the case
of the later, the user selects an email address and an
entity descriptor subject from respective comboboxes and
clicks a button. The button click event instantiates
Outlook and displays a New Mail document with the selected
email address and entity descriptor Subject pre-set. (The
Subject has a prefix which is used to identify and
associate subsequent replies, as described below!) When
the user completes and sends the email, the body text is
captured via the "WithEvents" linkage and is added to the
database.

Additionally, whenever new mail is received by Outlook,
the WithEvents linkage intercepts the item and examines
the Subject looking for a note identifier(mentioned
above). If found, the essence of the email (sender, body,
date received) is saved and associated with the
originating note in the form of a conversation thread.
(This thread can be extended ad infinitum.)

Also, on Startup, the VBA system examines the user's
Outlook Inbox looking for any unprocessed reply messages
and integrates them into the database as above.

My challenge is to replicate this process in the C# .Net
solution!

Nov 15 '05 #2
Eric,

C# doesn't support WithEvents. Rather, you will have to connect to
events on a class on your own using delegates. Check out the section of the
..NET framework titled "Consuming Events". It will detail how you can hook
up delegates to events in C# (as well as VB).

Hopet his helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Eric Chinn" <gs**@rogers.com> wrote in message
news:1f****************************@phx.gbl...
Nicholas:

Is the Office Add-in template available in VS Professional
2002!

Also, I'm having difficulty finding a C# counterpart to
the VBA "WithEvents" linkage!

Thanks for the speedy response!
-----Original Message-----
Eric,

This should be rather easy. You can create COM Add-

Ins for Outlook (or
any Office app really), and then distribute that to every

machine. I
believe there is a project template in the Enterprise

Edition of VS.NET for
an Office Add-In which you can use which will set up all

of the plumbing.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)

paldino=at=exisconsulting<dot>com

"Eric Chinn" <gs**@rogers.com> wrote in message
news:1a****************************@phx.gbl...
I am converting an Access 2k SQL Project to a WinForms
C# .Net solution. The last technical hurdle in this
exercise is to replace the integration with Outlook 2000. (Upgrading Outlook is not a solution!)

In the VBA system, a note facility exists which allows the user to associate a note with (almost)any business entity in the database. The note can be just text or it can be a replication of an email generated in Outlook! In the case of the later, the user selects an email address and an
entity descriptor subject from respective comboboxes and
clicks a button. The button click event instantiates
Outlook and displays a New Mail document with the selected email address and entity descriptor Subject pre-set. (The Subject has a prefix which is used to identify and
associate subsequent replies, as described below!) When
the user completes and sends the email, the body text is
captured via the "WithEvents" linkage and is added to the database.

Additionally, whenever new mail is received by Outlook,
the WithEvents linkage intercepts the item and examines
the Subject looking for a note identifier(mentioned
above). If found, the essence of the email (sender, body, date received) is saved and associated with the
originating note in the form of a conversation thread.
(This thread can be extended ad infinitum.)

Also, on Startup, the VBA system examines the user's
Outlook Inbox looking for any unprocessed reply messages
and integrates them into the database as above.

My challenge is to replicate this process in the C# .Net
solution!

.

Nov 15 '05 #3
Eric,

C# doesn't support WithEvents. Rather, you will have to connect to
events on a class on your own using delegates. Check out the section of the
..NET framework titled "Consuming Events". It will detail how you can hook
up delegates to events in C# (as well as VB).

Hopet his helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Eric Chinn" <gs**@rogers.com> wrote in message
news:1f****************************@phx.gbl...
Nicholas:

Is the Office Add-in template available in VS Professional
2002!

Also, I'm having difficulty finding a C# counterpart to
the VBA "WithEvents" linkage!

Thanks for the speedy response!
-----Original Message-----
Eric,

This should be rather easy. You can create COM Add-

Ins for Outlook (or
any Office app really), and then distribute that to every

machine. I
believe there is a project template in the Enterprise

Edition of VS.NET for
an Office Add-In which you can use which will set up all

of the plumbing.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)

paldino=at=exisconsulting<dot>com

"Eric Chinn" <gs**@rogers.com> wrote in message
news:1a****************************@phx.gbl...
I am converting an Access 2k SQL Project to a WinForms
C# .Net solution. The last technical hurdle in this
exercise is to replace the integration with Outlook 2000. (Upgrading Outlook is not a solution!)

In the VBA system, a note facility exists which allows the user to associate a note with (almost)any business entity in the database. The note can be just text or it can be a replication of an email generated in Outlook! In the case of the later, the user selects an email address and an
entity descriptor subject from respective comboboxes and
clicks a button. The button click event instantiates
Outlook and displays a New Mail document with the selected email address and entity descriptor Subject pre-set. (The Subject has a prefix which is used to identify and
associate subsequent replies, as described below!) When
the user completes and sends the email, the body text is
captured via the "WithEvents" linkage and is added to the database.

Additionally, whenever new mail is received by Outlook,
the WithEvents linkage intercepts the item and examines
the Subject looking for a note identifier(mentioned
above). If found, the essence of the email (sender, body, date received) is saved and associated with the
originating note in the form of a conversation thread.
(This thread can be extended ad infinitum.)

Also, on Startup, the VBA system examines the user's
Outlook Inbox looking for any unprocessed reply messages
and integrates them into the database as above.

My challenge is to replicate this process in the C# .Net
solution!

.

Nov 15 '05 #4
Nicholas:

Is the Office Add-in template available in VS Professional
2002!

Also, I'm having difficulty finding a C# counterpart to
the VBA "WithEvents" linkage!

Thanks for the speedy response!
-----Original Message-----
Eric,

This should be rather easy. You can create COM Add- Ins for Outlook (orany Office app really), and then distribute that to every machine. Ibelieve there is a project template in the Enterprise Edition of VS.NET foran Office Add-In which you can use which will set up all of the plumbing.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot) paldino=at=exisconsulting<dot>com
"Eric Chinn" <gs**@rogers.com> wrote in message
news:1a****************************@phx.gbl...
I am converting an Access 2k SQL Project to a WinForms
C# .Net solution. The last technical hurdle in this
exercise is to replace the integration with Outlook 2000. (Upgrading Outlook is not a solution!)

In the VBA system, a note facility exists which allows the user to associate a note with (almost)any business entity in the database. The note can be just text or it can be a replication of an email generated in Outlook! In the case of the later, the user selects an email address and an
entity descriptor subject from respective comboboxes and
clicks a button. The button click event instantiates
Outlook and displays a New Mail document with the selected email address and entity descriptor Subject pre-set. (The Subject has a prefix which is used to identify and
associate subsequent replies, as described below!) When
the user completes and sends the email, the body text is
captured via the "WithEvents" linkage and is added to the database.

Additionally, whenever new mail is received by Outlook,
the WithEvents linkage intercepts the item and examines
the Subject looking for a note identifier(mentioned
above). If found, the essence of the email (sender, body, date received) is saved and associated with the
originating note in the form of a conversation thread.
(This thread can be extended ad infinitum.)

Also, on Startup, the VBA system examines the user's
Outlook Inbox looking for any unprocessed reply messages
and integrates them into the database as above.

My challenge is to replicate this process in the C# .Net
solution!

.

Nov 15 '05 #5

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

Similar topics

9
by: Kurt | last post by:
Hi I was trying to get this VB type code to work in C Sub SetColumns_Example( Dim ol As Outlook.Applicatio Dim MyFolder As MAPIFolde Dim itms As Item Dim itm As Objec Dim dtmStart As Date,...
2
by: Johnny | last post by:
Hi, I want to take a word document and convert it to a postscript file in both a windows app or ASP.NET app. I've read that someone have done this in this newsgroup, but I have not been able to...
1
by: Glenn Wilson | last post by:
I have been given a small project and was looking for some help. I need to convert doc file to tif documents, now I can do this by using a printer driver to do the change, but I need to be able to...
8
by: Gee | last post by:
I get the above error with this code and I can't figure out why? Any ideas please? See code below - the actual error is included in the code: public struct NETRESOURCE { public Int32...
3
by: Jon S via DotNetMonster.com | last post by:
Hi all, Is there a way to convert an Access.mdb from one format (say Access '97 or Access 2000) to Access 2002 format using ADO.NET and C#??? I know how to do it manually using the Access DBMS...
1
by: vishal™ | last post by:
I have come to know that bits is a concept being used for data transfer over the internet. I want to use this technology in my vb.net application. for this i tried to convert the 'BITS.IDL' file...
4
by: CJ | last post by:
Hi I'm trying to send email via a c# app, and I've come across various ways to do it, but the way that seems best given my constraints is this little vbscript: Dim theApp, theNameSpace,...
4
by: chandu | last post by:
Hello, i need to convert a word doc into xml format and need to store that xml doc in to a sqlserver database.. how to convert a word doc to xml and after retrieving that xml doc from database...
5
by: Maxim | last post by:
Hi all, I'm calling a COM Interface method that returnes SafeArray wrapped into variant. Is it possible to convert it to managed array? Because working with SAFEARRAY directly is a bit...
9
by: =?iso-8859-1?B?S2VyZW0gR/xtcvxrY/w=?= | last post by:
Hi, i am a little stuck here, how do i convert this from C Structure to an structure in C# that can be marshalled: typedef struct _DEV_BROADCAST_DEVICEINTERFACE { DWORD dbcc_size; DWORD...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...

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.