open a message file *.msg in outlook 2000 using vba 
Author Message
 open a message file *.msg in outlook 2000 using vba

Hello !
I want to open a  msg file  ( outlook ) that has an attachment in it
using vba.
I try to do it using the shell command  with the \f switch  in it
like:
    Dim MyAppID As Variant
    MyAppID = Shell("c:\Program Files\Microsoft Office 2000
office\outlook.exe /f  buffer ,vbNormalFocus)
where buffer is the name of the file but it open the file only if it
does not include an attachment  otherwith it return an outlook error
message that the switch is not ok .
I try to use other way

          Dim oOL As Outlook.Application
          Set oOL = CreateObject("Outlook.Application")
          oOL.CreateItemFromTemplate(buffer)
          MyAppID = Shell(oOL & " /f ", vbNormalFocus)

but it only open the outlook and not the file.
Help will be wellcome.

With thanks ahead

Doron



Sat, 10 Jul 2004 18:17:51 GMT  
 open a message file *.msg in outlook 2000 using vba
CreateItemFromTemplate() returns a new mail item, that's what you need to use

set NewItem=oOL.CreateItemFromTemplate(buffer)
MsgBox NewItem.Attachments.Count

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool


Quote:
> Hello !
> I want to open a  msg file  ( outlook ) that has an attachment in it
> using vba.
> I try to do it using the shell command  with the \f switch  in it
> like:
>     Dim MyAppID As Variant
>     MyAppID = Shell("c:\Program Files\Microsoft Office 2000
> office\outlook.exe /f  buffer ,vbNormalFocus)
> where buffer is the name of the file but it open the file only if it
> does not include an attachment  otherwith it return an outlook error
> message that the switch is not ok .
> I try to use other way

>           Dim oOL As Outlook.Application
>           Set oOL = CreateObject("Outlook.Application")
>           oOL.CreateItemFromTemplate(buffer)
>           MyAppID = Shell(oOL & " /f ", vbNormalFocus)

> but it only open the outlook and not the file.
> Help will be wellcome.

> With thanks ahead

> Doron



Sun, 11 Jul 2004 01:33:57 GMT  
 open a message file *.msg in outlook 2000 using vba

Quote:

> Hello !
> I want to open a  msg file  ( outlook ) that has an attachment in it
> using vba.
> I try to do it using the shell command  with the \f switch  in it
> like:
>     Dim MyAppID As Variant
>     MyAppID = Shell("c:\Program Files\Microsoft Office 2000
> office\outlook.exe /f  buffer ,vbNormalFocus)
> where buffer is the name of the file but it open the file only if it
> does not include an attachment  otherwith it return an outlook error
> message that the switch is not ok .
> I try to use other way

>           Dim oOL As Outlook.Application
>           Set oOL = CreateObject("Outlook.Application")
>           oOL.CreateItemFromTemplate(buffer)
>           MyAppID = Shell(oOL & " /f ", vbNormalFocus)

> but it only open the outlook and not the file.
> Help will be wellcome.

> With thanks ahead

> Doron

Hello !
Thanks for the quick response, but what a mean in my question is to open
Outlook   and showing the message and all attachment like if you are doing it  by
    pressing with your mouse on the message .

with thanks ahead Doron



Sun, 11 Jul 2004 15:51:50 GMT  
 open a message file *.msg in outlook 2000 using vba
Shell("c:\SomeFile.mgs", vbNormalFocus)

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool



Quote:
> > Hello !
> > I want to open a  msg file  ( outlook ) that has an attachment in it
> > using vba.
> > I try to do it using the shell command  with the \f switch  in it
> > like:
> >     Dim MyAppID As Variant
> >     MyAppID = Shell("c:\Program Files\Microsoft Office 2000
> > office\outlook.exe /f  buffer ,vbNormalFocus)
> > where buffer is the name of the file but it open the file only if it
> > does not include an attachment  otherwith it return an outlook error
> > message that the switch is not ok .
> > I try to use other way

> >           Dim oOL As Outlook.Application
> >           Set oOL = CreateObject("Outlook.Application")
> >           oOL.CreateItemFromTemplate(buffer)
> >           MyAppID = Shell(oOL & " /f ", vbNormalFocus)

> > but it only open the outlook and not the file.
> > Help will be wellcome.

> > With thanks ahead

> > Doron

> Hello !
> Thanks for the quick response, but what a mean in my question is to open
> Outlook   and showing the message and all attachment like if you are doing it
by
>     pressing with your mouse on the message .

> with thanks ahead Doron



Mon, 12 Jul 2004 02:44:36 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How do I open a msg file programatically in vba as a SENT file

2. Xfering .msg files from file system to MAPI folder using VBA

3. VBA - Get .msg File Name from Message!!

4. How can I receive the unread message count in the Outlook 2000 Inbox using VBScript

5. Opening .msg files in Outlook via COM

6. How to open an Outlook 98 .MSG file?

7. How do you send Outlook 2000 email using WORD 97 VBA Macro

8. Using the Outlook 2000 VBA in Reveived mail

9. Change option in Outlook 2000 using VBA

10. programmatically creating, modifying, or deleting Exchange 2000-based rules using VBA through Outlook 2002

11. open a msg.file from VBA

12. Using Outlook 2000 VBA in received mail.

 

 
Powered by phpBB® Forum Software