?
Solved

open OST (template) into a new mail-message (Outlook 2003) from a Winform  VB2003

Posted on 2007-08-05
15
Medium Priority
?
405 Views
Last Modified: 2012-05-05
Hi Experts,

I have a winform with a button. I would like to click the button and have it:
1.launch Outlook 2003
2.auto-load a saved OST file into a new mail message.

So far, I can click the button and have it load Outllook:

---code-----

 Try
  System.Diagnostics.Process.Start("outlook")
            Catch ex As Exception
          msg("Error")
        End Try
---------------

But I'm not sure how to point to the OST file which I created on c:\

Pls Help,
Roberto
0
Comment
Question by:RobertoFreemano
  • 8
  • 7
15 Comments
 
LVL 19

Expert Comment

by:William Elliott
ID: 19634771
do you mean load an oft? or ost?
0
 
LVL 19

Expert Comment

by:William Elliott
ID: 19634858
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItemFromTemplate _     ("C:\somewhere\myspecial.oft")
myItem.Display
0
 

Author Comment

by:RobertoFreemano
ID: 19635514
Hi,

I mean an Outlook Template (OFT) file

Cheers,
Roberto
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 19

Expert Comment

by:William Elliott
ID: 19651633
did that help? need more help?
0
 

Author Comment

by:RobertoFreemano
ID: 19653506
Hi weellio,

will try this later on today and get back to you.

Cheers,
Roberto
0
 

Author Comment

by:RobertoFreemano
ID: 19726030
Hi weellio,

 this code didn't work :(  is this code compatible with VB.NET 2003?

Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItemFromTemplate _     ("C:\somewhere\myspecial.oft")
myItem.Display

1. it stated that myOIApp was not declared.... so I wrote = dim myOIApp as Object?????

My vb skill aren't very advanced...
0
 
LVL 19

Accepted Solution

by:
William Elliott earned 800 total points
ID: 19726170
after you dimmed it, then what did it do?
do you have the template save in the location listed?

i created a generic oft
i opened VS but a button on a blank form

entered this code


Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim myOlApp As Object
        Dim myitem As Object
        myOlApp = CreateObject("Outlook.Application")
        myItem = myOlApp.CreateItemFromTemplate _
            ("C:\b.oft")
        myItem.Display()
    End Sub
End Class

hit the button
and the form opened
0
 

Author Comment

by:RobertoFreemano
ID: 19726189
That worked...

great!!!!!!!!!!!!!!!!!!!!!!

Cheers weellio
0
 

Author Comment

by:RobertoFreemano
ID: 19726696
Hi weellio,

I was just wondering if there was a way I could get text from a textbox to deplay in TO: field once the OFT opens?

so if i write an email address in a textbox on a winform... and click BUTTON1.. it will do as above?

Hope you can help?
Cheers,
Roberto
0
 
LVL 19

Expert Comment

by:William Elliott
ID: 19726759
what is your end result wil all of this? maybe i could just throw it all together.
0
 

Author Comment

by:RobertoFreemano
ID: 19726787
basically,

I'm bored of writing endless emails in work to users who have forgoten at add details on their requests; so I  wanted to create an automated VB app that would allow me to send 'pre-scripted' emails back to users...

I have achived this through the mailto: function... but it is only basic and I couldn't have background images or attachments...

So I came across the OFT when embeds all the data - except the FROM/TO/SUBJECT info..
0
 
LVL 19

Expert Comment

by:William Elliott
ID: 19726818
there are several ways to do this,...

one is to create a script in the rules wizard that will reply automatically depending on iformation parsed through  a recieved mail message (this will require a lot of code depending on the format of the  emails you recieve)

one is vbscript.

and the other is what is seems you are going for, but i'd go a different way..
go here and do this. http://www.freevbcode.com/ShowCode.asp?ID=6401

then maybe once you have ti working, we can manipulate it to add drop down boxes that have canned messages or something.
0
 
LVL 19

Expert Comment

by:William Elliott
ID: 19726822
0
 

Author Comment

by:RobertoFreemano
ID: 19726914
Hi weellio,

I followed the code word-for-word from http://www.freevbcode.com/ShowCode.asp?ID=6401& even added References:

System.web
System.web.Services

And the following into Imports:

System.Net.Mail

And still get the following error:

Namespace or type Mail in the project-level Imports System.Net.Mail cannot be found.

Any Ideas?
0
 
LVL 19

Expert Comment

by:William Elliott
ID: 19727132
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question