Board index » delphi » Outlook Question

Outlook Question


2003-10-24 04:26:28 AM
delphi162
Hi,
We are using Delphi 7 Enterprise. I need to write a Delphi program
that will start Microsoft Outlook, create a new e-mail, and attach a
document to it. Not sure where to start. Does anyone know any good
references with code examples on how to do this?
Also, which Type Library should I import into my Delphi program in
order to accomplish the above tasks?
Any help appreciated.
R
 
 

Re:Outlook Question

<<Ron:
I need to write a Delphi program that will start Microsoft
Outlook, create a new e-mail, and attach a document to it.
Not sure where to start.
www.dimastr.com/
--
Deborah Pate (TeamB) delphi-jedi.org
TeamB don't see posts sent via Google or ISPs
Use the real Borland server: newsgroups.borland.com
www.borland.com/newsgroups/genl_faqs.html
 

Re:Outlook Question

Outstanding references - thank you very much.
Follow-up question: As an added requirement they also want me to do the
same with Outlook Express (in addition to Outlook 2000). I get the
impression from looking at the type libraries, and references that the OLE
interface is only to Outlook 8 and Outlook 2000 and not Outlook Express - is
this true? If yes, is there an alternative method for launching Outlook
Express, creating a new mail item, and attaching a document?
R
Deborah Pate (TeamB) <XXXX@XXXXX.COM>writes
 

Re:Outlook Question

You may use MAPI that will work with most mailers (MS Outlook, Outlook
Express, Eudora, TheBat etc).
See our freeware component for emailing:
www.scalabium.com/mapimail.htm
"Ron" <XXXX@XXXXX.COM>writes
Quote
Hi,

We are using Delphi 7 Enterprise. I need to write a Delphi program
that will start Microsoft Outlook, create a new e-mail, and attach a
document to it. Not sure where to start. Does anyone know any good
references with code examples on how to do this?

Also, which Type Library should I import into my Delphi program in
order to accomplish the above tasks?

Any help appreciated.


R


 

Re:Outlook Question

Mike Shkolnik writes:
Quote
You may use MAPI that will work with most mailers (MS Outlook, Outlook
Express, Eudora, TheBat etc).
See our freeware component for emailing:
www.scalabium.com/mapimail.htm
To be correct, MAPI is only really supported by Outlook and Exchange.
*Simple MAPI* is supported by the other clients you mention.
--
Regards,
Steve Moss,
CoCo Systems Ltd.
Delphi 6.02, Win2K + SP4
 

Re:Outlook Question

Yes, I wrote about Simple MAPI that is supported in most mailers and that is
enough for message creation (in original question)
"Steve Moss" <XXXX@XXXXX.COM>???????/???????? ? ????????
?????????: news:3f98dd9e$XXXX@XXXXX.COM...
Quote
Mike Shkolnik writes:

>You may use MAPI that will work with most mailers (MS Outlook, Outlook
>Express, Eudora, TheBat etc).
>See our freeware component for emailing:
>www.scalabium.com/mapimail.htm

To be correct, MAPI is only really supported by Outlook and Exchange.
*Simple MAPI* is supported by the other clients you mention.

--
Regards,
Steve Moss,
CoCo Systems Ltd.

Delphi 6.02, Win2K + SP4
 

Re:Outlook Question

Mike Shkolnik writes:
Quote
Yes, I wrote about Simple MAPI that is supported in most mailers and
that is enough for message creation (in original question)
Well, actually, no. What you wrote was ...
Quote
>You may use MAPI that will work with most mailers (MS Outlook,
Outlook Express, Eudora, TheBat etc). <<
Sure, Simple MAPI is sufficient to fulfill Ron's original question, but
while you may know the difference there is a common misconception on
these n/gs that MAPI is the same as Simple MAPI. It is not, of course.
Statements such as yours only serve to prolong this misconception,
which I why I have posted here.
--
Regards,
Steve Moss,
CoCo Systems Ltd.
Delphi 6.02, Win2K + SP4
 

Re:Outlook Question

Hi Ron,
You can also take a look at Easy MAPI. With Easy MAPI you can use the
Extended MAPI or Simple MAPI interfaces (which one you want to use) to
accomplish this.
You can find more info about Easy MAPI on our website.
With regards,
Peter.
XXXX@XXXXX.COM
www.rapware.com/
"Ron" <XXXX@XXXXX.COM>writes
Quote
Hi,

We are using Delphi 7 Enterprise. I need to write a Delphi program
that will start Microsoft Outlook, create a new e-mail, and attach a
document to it. Not sure where to start. Does anyone know any good
references with code examples on how to do this?

Also, which Type Library should I import into my Delphi program in
order to accomplish the above tasks?

Any help appreciated.


R


 

Re:Outlook Question

I'm not sure what you are building Ron, but maybe our CRM application will
do all you want anyway. Go to www.UCAP and have a look
Peter
"Ron" <XXXX@XXXXX.COM>writes
Quote
Hi,

We are using Delphi 7 Enterprise. I need to write a Delphi program
that will start Microsoft Outlook, create a new e-mail, and attach a
document to it. Not sure where to start. Does anyone know any good
references with code examples on how to do this?

Also, which Type Library should I import into my Delphi program in
order to accomplish the above tasks?

Any help appreciated.


R


 

Re:Outlook Question

How can I retrieve everything from the calendar within a selected period?
Thanks
 

Re:Outlook Question

Something along the lines (VB):
Set Oitems = Folder.Items
strFilter = "(" & "[Start]>= """ & FormatDateTime(Now, vbShortDate) & " " &
FormatDateTime(Now, vbShortTime) & """" & ")"
With Oitems
.Sort "Start", False
'.IncludeRecurrences = True
.Restrict (strFilter)
End With
For i = 1 To Oitems.Count
Debug.Print Oitems(i).Subject
Next
Dmitry Streblechenko (MVP)
www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Darren" <D arren @pclegends.com>writes
Quote
How can I retrieve everything from the calendar within a selected period?

Thanks

 

Re:Outlook Question

Thanks Dmitry, got me pointed in the right direction, here is how you get
it...
var
NS: NameSpace;
F : MapiFolder;
X : Integer;
M : String;
I : Items;
begin
NS := OutlookApplication1.GetNamespace('MAPI');
F := NS.GetDefaultFolder(olFolderCalendar);
F.Items.IncludeRecurrences := True;
F.Items.Sort('Start',False);
I := F.Items.Restrict('([Start]>="01/01/2007")');
For X := 1 to I.Count do
M := M + FormatDateTime('mm/dd/yyyy',appointmentitem(I.Item(x)).Start)+
' - ' + appointmentitem(I.Item(x)).Subject+#13;
ShowMessage(M);