Renaming E-mail attachment in outlook or thunderbird

Hi Guys,

Here's my problem. I have a standalone computer and a server. both run the same database. On the server the SQL database in synchronized with a program called DBsinc to the ms access database.
I also have changes on my computer and need some way to update the database on the server and update my own database from the server database. I know this is not the way I should approach this problem but it looks like it's my only option for the moment.
Due to security reasons where I work it is not possible to go around this using FTP. That means my only way out is by using email. I have written some code to automatically send an email and attached a table with the necessary update data. Now I need some way to get the attachment out of the email with VBA. Im currently using Thunderbird witch has the option to store attachments in a different folder on the computer. Unfortunately it refuses to do so.

What I need to know is how to isolate a attachment from an email and save it in a specified folder. Using thunderbird, outlook or any other program I can easily download is just fine.
LVL 1
dpragerAsked:
Who is Participating?
 
Chris BottomleyConnect With a Mentor Software Quality Lead EngineerCommented:
0
 
Chris BottomleySoftware Quality Lead EngineerCommented:
As an exampole see her for outlook.

Any clarification or tweaking required then of course ask.

Chris
0
 
dpragerAuthor Commented:
Thanx,

The code you gave me Works perfect. There are just a few little things that need to alter.

The code only removes the attachments of the selected emails and puts them in the specified folder entered in the input box. Im lazy so I dont want to open Outlook explorer and select the specified email.

Is there a way in the code to select all of the emails listed in inbox and replace all of the attachments of the email messages there? I think I should alter the code listed below but I dont really know how.

Second of all I get a message that program is trying to alter my emails ( can I get rid of this annoying message ? )

On Error Resume Next
   
    'work on selected items
    Set myOlExp = myOlApp.ActiveExplorer
    Set myOlSel = myOlExp.Selection ( needs to be all emails  in inbox in this line)
   
    'for all items do...
    For Each myItem In myOlSel
   
        'point on attachments
        Set myAttachments = myItem.Attachments
       
        'if there are some...
        If myAttachments.Count > 0 Then
       
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
Chris BottomleySoftware Quality Lead EngineerCommented:
1. To select all items:
change
    Set myOlExp = myOlApp.ActiveExplorer
    Set myOlSel = myOlExp.Selection ( needs to be all emails  in inbox in this line)
     
    'for all items do...
    For Each myItem In myOlSel
to
    Set myOlExp = myOlApp.ActiveExplorer
    Set myOlSel = myOlExp..getnamespace("MAPI").getdefaultfolder(6)
   
    'for all items do...
    For Each myItem In myOlSel.items

Ought to do it.

2. Pesky message, assuming 2003 or earlier then personally I find  mapilab to be ideal but see:
You can modify your code to use redemption:
http://www.dimastr.com/redemption/

You can use an outlook add-in i.e:
http://www.mapilab.com/outlook/security

Or finally you can use clickyes
http://www.contextmagic.com/

ANy help?

Chris

 
0
 
dpragerAuthor Commented:
Thanx again,

But don't have it working yet. The counter stays empty in some strange way. Could you please take a look at the attached screenshot.

< i >  is empty so the VB code gets caught in an infinite loop and the program crashes.



0
 
dpragerAuthor Commented:
Thanx again,

But don't have it working yet. The counter stays empty in some strange way. Could you please take a look at the attached screenshot.

< i >  is empty so the VB code gets caught in an infinite loop and the program crashes.




SCR.JPG
0
 
Chris BottomleySoftware Quality Lead EngineerCommented:
Looks alright albeit I don't have 2000.

If you set a watch on i, and step through the delete block how does it look on entry and on each step?

Chris
0
 
Chris BottomleySoftware Quality Lead EngineerCommented:
The other thing is use the mechanism:

for i = myattachments.count to 1 step -1
     save it
     delete it
next

Chris
0
 
dpragerAuthor Commented:
Thanx, it took me a while to get corking the way I wanted it to but it works great now !!

Thanx Defenitly worth full points !!
0
 
Chris BottomleySoftware Quality Lead EngineerCommented:
Glad to be of some help and thank you for the grade.

Chris
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.