Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is it possible to open outlook from asp.net c# intranet?

Status
Not open for further replies.

mikemardon

Programmer
May 23, 2005
71
GB
Hi

I am trying to create 2 hyperlinks, one should open outlook (2003) with the default inbox view and the other should open outlook with a view of the shared company calendar.

Is this possible?

Many Thanks
 
Found this sample here
Code:
Imports outlook

Dim objOutlk As New Outlook.Application 'Outlook
Const olMailItem As Integer = 0
Dim objMail As New System.Object
objMail = objOutlk.CreateItem(olMailItem) 'Email item
objMail.To = emaila.Text
objMail.cc = "" 'Enter an address here To include a carbon copy; bcc is For blind carbon copy's
'Set up Subject Line
objMail.subject = "Quality Assurance Letter"
'To add an attachment, use:
'objMail.attachments.add("C:\MyAttachmentFile.txt")
dim msg as string
msg = "body test msg"
objMail.body = msg
'Use this To display before sending, otherwise call objMail.Send to send without reviewing
objMail.display()
'Use this To display before sending, otherwise call objMail.Send to send without reviewing
'Clean up
objMail = Nothing
objOutlk = Nothing

This also works...

Code:
[URL unfurl="true"]http://www.google.com/search?hl=en&q=asp.net+open+outlook&btnG=Google+Search[/URL]
 
unless this code is activeX it will execute on the server, not the client. it works on your local box because the client and server are the same machine.

the code sample is sending an email message. this can be done via the SmtpClient object, which is much simpler and effecient.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
The guy said it worked on the client - that's why I posted it. I didn't test, just Gooogled.
 
Thanks for your replies

Just to clarify, I need to find a way of opening the outlook (2003) application with different default views - one being the inbox and the second the shared calendar - I don't want to create a new message!

 
sorry - the intranet site will be opened in a terminal services session so it will be on the server

Thanks
 
I expect there will be two potential ways of doing this:

1. If Outlook supports command arguments, there may be some for defaulting which view to open. You could then start a new process and pass in those arguments.

2. Using the Outlook Object Model, have a look at what methods and properties exist and see if there is anything that will allow you to change the view. There will probably be an associated "Open" command to actually open an instance of Outlook.


-------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
 
System.Diagnostics.Process.Start(Filename,username ,password,Domain)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top