A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Saving email attachments



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 21st 08, 04:07 PM posted to microsoft.public.outlook.program_vba
Nigel RS
external usenet poster
 
Posts: 16
Default Saving email attachments

Sorted - there are non-printable characters in the MailItem.Body, I have put
in a function to strip these out and everything works as expected.

Cheers

"Nigel RS" wrote:

Hi Ken
I have changed the path by setting it directly

SaveFolder = "D:\"

not from itm.Body and it works OK!!

Very strange, as in debug mode the text string looks identical.

"Ken Slovak - [MVP - Outlook]" wrote:

The code looks OK offhand, what sort of path strings are you getting? Do the
paths other than the file name actually exist?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Nigel RS" wrote in message
...
I am using the following code, that runs from an outlook rule, to save
attachments
to a path defined by the contents of the email body. For example in my
email body I have the text string
D:\

I receive an error despite the path and file looking OK.

Help!

Sub ANYPATH(itm As Outlook.MailItem)

Dim objatt As Outlook.Attachment
Dim SaveFolder As String
SaveFolder = Trim(itm.Body)

For Each objatt In itm.Attachments
objatt.SaveAsFile SaveFolder & objatt.DisplayName
Next

Set objatt = Nothing

End Sub



  #2  
Old October 24th 08, 10:21 PM posted to microsoft.public.outlook.program_vba
gp
external usenet poster
 
Posts: 13
Default Saving email attachments

Nigel,

I have been looking for a function to remove non-printable characters from
e-mail subject text. Can you share your function?

Thanks, GP


"Nigel RS" wrote:

Sorted - there are non-printable characters in the MailItem.Body, I have put
in a function to strip these out and everything works as expected.

Cheers

"Nigel RS" wrote:

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
popup balloon on saving email attachments vonClausowitz Outlook and VBA 3 July 1st 08 05:00 PM
saving all attachments where the some of the attachments have thesame name nosliwmada Outlook - General Queries 0 December 6th 07 03:48 PM
quick code for saving email attachments Co Outlook - General Queries 1 November 29th 07 01:08 PM
default location for saving email attachments Jeanette Outlook - Installation 2 October 13th 06 06:25 PM
saving attachments T Outlook Express 1 April 16th 06 04:16 PM


All times are GMT +1. The time now is 11:39 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.