Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / June 2007

Tip: Looking for answers? Try searching our database.

Creating mailitem with reply/reply to all/forward buttons

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
chrisl - 21 Jun 2007 09:27 GMT
Hi,

I have an application that reads a .msg file from disk and uses an Outlook
object to create the outlook instance and a mailitem using the
CreateItemFromTemplate method on the application object.

When I execute the Display(object modal) method on the mailitem the form
displays the mail message as a new item with the Send button.

As the .msg file is actually a saved mail from a received email in an
outlook folder I need it to recognise it as a mail that has to show the
Reply/Reply to All/Forwad buttons (as it does if I double click the file on
the disk).

I can't seem to find anywhere how I force the mailitem to natively
understand the mail is to be displayed in a response mode and not a new item
mode.

Any help is appreciated.
Hollis Paul - 21 Jun 2007 16:29 GMT
> I can't seem to find anywhere how I force the mailitem to natively
> understand the mail is to be displayed in a response mode and not a new item
> mode.

CreateItemfromTemplate should always create the item to send.  I think what you
want to do is just open the existing item. Look for a method that opens the
item from the file system.

--
Hollis Paul
Mukilteo, WA  USA
chrisl - 21 Jun 2007 23:41 GMT
This is the problem. There doesn't seem to be a method that does this that I
can find and there doesn't seem any obvious way of setting a property on the
mail object to get it into a reply mode.

> > I can't seem to find anywhere how I force the mailitem to natively
> > understand the mail is to be displayed in a response mode and not a new item
[quoted text clipped - 7 lines]
> Hollis Paul
> Mukilteo, WA  USA
Sue Mosher [MVP-Outlook] - 21 Jun 2007 23:55 GMT
You should be able to execute any file that has a file type association by using Windows Script Host:

You can use Windows Script Host to run any program:

Set objShell = CreateObject("WScript.Shell")
strPath = Chr(34) & "C:\your path\your file.msg" & Chr(34)
objShell.Run strPath

Once the item is open, it will be available from the Inspectors collection.
Signature

Sue Mosher, Outlook MVP
  Author of Microsoft Outlook 2007 Programming:
    Jumpstart for Power Users and Administrators
   http://www.outlookcode.com/article.aspx?id=54

> Hi,
>
[quoted text clipped - 15 lines]
>
> Any help is appreciated.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.