473,386 Members | 1,842 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,386 software developers and data experts.

Interfacing with COM

**Programming newbie**

I'd like to write some C# that interacts with a COM object ("automation
library"?). I don't quite know what to look for though to find examples.

I'm guessing if I can find some demos of C# using COM objects like that from
MS Office, that might get me started?

Marco
Mar 19 '07 #1
1 1390
Bob
Hi Marco,
If you reference a dll in your project .net creates an Interop wrapper that
lets you interact with it.
regarding Office you reference the Office PIAs (Primary Interop Assemblies)
these can be downloaded from Microsoft.

I have had a quick play but haven't done anything substantial.
Play code follows:
hth
Bob
using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using Outlook = Microsoft.Office.Interop.Outlook;

namespace TestOutLookPIA

{

public partial class Form1 : Form

{

private Outlook.Application outlook;

public Form1()

{

InitializeComponent();

outlook = new Outlook.ApplicationClass();

outlook.GetNamespace("MAPI");

Outlook.MailItem myMail;

myMail=(Outlook.MailItem)outlook.CreateItem(Micros oft.Office.Interop.Outlook.OlItemType.olMailItem);

myMail.Recipients.Add(my*******@mydomain.com);

myMail.Body = "Test Message";

myMail.Subject = "Test Mail";

myMail.Send();
}

}

}

"Marco Shaw" <marcoDOTshaw_@_gmailDOTcomwrote in message
news:u9*************@TK2MSFTNGP03.phx.gbl...
**Programming newbie**

I'd like to write some C# that interacts with a COM object ("automation
library"?). I don't quite know what to look for though to find examples.

I'm guessing if I can find some demos of C# using COM objects like that
from MS Office, that might get me started?

Marco

Mar 20 '07 #2

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

Similar topics

0
by: 2mc | last post by:
All, I'm getting a better handle on Python and NumPy. I've found solutions to many of my questions. Thanks to all. I would like to interface Python (in WinXP) with another program through...
4
by: Chuck Amadi | last post by:
Hi all Anyone know a good Pygresql Tutorial for Interfacing between Python & Postgresql . Cheers Chuck
12
by: David Walker | last post by:
Hi I have a program which I need to interface with a webpage - the webpage will accept an input (probably a 'post' string from the program) and then will process it and needs to return a value. ...
4
by: Shaurya Anand | last post by:
I would like to know more about Interfacing hardware devices through .NET. We're students and what we're trying to do is control our robots with printer or serial port interfacing... very similar...
3
by: Kevin | last post by:
Hi All I got some good responses from some of you guys regarding me serial port interfacing problem that I posted a little while back. However your help leaded me to this link belo ...
2
by: headware | last post by:
I'm relatively new to ASP.NET and ADO.NET, but I have a basic design question regarding the use of web services and APS.NET applications. Right now we have an application that uses web services to...
1
by: Neil | last post by:
Our hosting company's server went down a few days ago. After they fixed it, our PHP Page and Database are not interfacing. They are not believing me that I have done nothing on my end in several...
1
by: keliie | last post by:
Hello, I've recently completed a database that tracks my food purchases and inventory and I want to add another piece to the database that tracks sales. Our company's waitstaff enters order...
2
by: abhay | last post by:
hi,i m interfacing gsm modem to my microcontroller.i need to send sms through it. i am using AT commands for that.the command to send sms (AT+ CMGS) terminates with ctrl-Z.now in my program i hav...
6
by: dev | last post by:
hi i want to know about interfacing or accessing a serial port using c-program please help me with an example thanks for whom who reply me soon
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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:
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.