Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-21-2014, 07:13 AM
megatronixs megatronixs is offline take emails from outlook mailbox and folders to Access Windows 7 32bit take emails from outlook mailbox and folders to Access Office 2003
Advanced Beginner
take emails from outlook mailbox and folders to Access
 
Join Date: Aug 2012
Posts: 42
megatronixs is on a distinguished road
Default

Hi Gmayor,

I found this code that works to save all the selected emails in a folder. It works great, but would be nice it was possible to adjust the above code from previouw messages to not only save the email content to a table but also the emails into a folder so I could click on a button and open the linked email. (the below code only refers to the selected emails).



Any ideas how to combine both codes?

Code:
Public Sub Command24_Click()
Dim olItem As Outlook.MailItem
Dim fName As String
Dim fPath As String
    fPath = "C:\Messages\"
    For Each olItem In ActiveExplorer.Selection
        fName = Format(olItem.ReceivedTime, "yyyymmdd") & Chr(32) & _
                Format(olItem.ReceivedTime, "HH.MM") & Chr(32) & _
                olItem.SenderName & " - " & olItem.Subject & ".msg"
        fName = Replace(fName, Chr(58) & Chr(41), "")
        fName = Replace(fName, Chr(58) & Chr(40), "")
        fName = Replace(fName, Chr(34), "-")
        fName = Replace(fName, Chr(42), "-")
        fName = Replace(fName, Chr(47), "-")
        fName = Replace(fName, Chr(58), "-")
        fName = Replace(fName, Chr(60), "-")
        fName = Replace(fName, Chr(62), "-")
        fName = Replace(fName, Chr(63), "-")
        fName = Replace(fName, Chr(124), "-")
        olItem.SaveAs fPath & fName
    Next olItem
    Set olItem = Nothing
    
End Sub
Greetings.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to synchronize emails in certain folders when upgrade Outlook 2010 to Outlook 201 davip Outlook 0 07-30-2013 09:07 PM
Moving emails in shared mailbox to personal mailbox hlock Outlook 0 12-12-2012 02:32 PM
Outlook 2010 & Mailbox Access Stkitts11 Outlook 0 04-10-2012 06:48 AM
take emails from outlook mailbox and folders to Access Merging outlook folders and emails rudihorvath Outlook 1 03-16-2012 07:03 AM
take emails from outlook mailbox and folders to Access Outlook 07 Not Fetching Emails in Random folders miccguido Outlook 1 02-14-2012 01:51 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:37 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft