+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Spammer
    Join Date
    02-26-2009
    Location
    U.S
    MS-Off Ver
    Outlook
    Posts
    67

    Macro or Code to save email as RTF files

    Hi

    I need to save my emails as rtf files in a particular folder in the hard drive.

    I have numerous emails stored in a subfolder of my personal folder in
    Outlook. The files are currently in an Outlook msg format. I want to
    convert them to RTF and store them.

    I am curious if anybody knows of a macro or VBA that will save all emails
    in
    the folder as RTF and save them to a widows folder for example:
    C:\Outlook\Messages

    Please advise.

    Thanks in advance,

  2. #2
    Forum Administrator
    Join Date
    03-18-2009
    Location
    India
    MS-Off Ver
    2003,2007
    Posts
    222

    Re: Macro or Code to save email as RTF files

    Hi jesika,
    By this code you will be able to auto-save the emails directly to your hard disk.Try this.

    Code:
    procedure TAddInModule.adxOutlookAppEvents1NewMail(Sender: TObject);
    var
    outlook1: olevariant;
    mymailitem: olevariant;
    begin
    
    try
    Outlook1 := GetActiveOleObject('Outlook.Application');
    except
    Outlook1 := CreateOleObject('Outlook.Application');
    end;
    try
    olsecuritymanager1.DisableoomWarnings := True;
    except
    olsecuritymanager1.DisableoomWarnings := False;
    end;
    
    mymailitem:=outlook1.activeexplorer.selection.item(1);
    mymailitem.SaveAs('c:\mail\'+floattostr(now)+'.msg');
    
    olsecuritymanager1.DisableoomWarnings := False;
    outlook1:=unassigned;
    
    end;
    ExlGuru

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0