![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I have vba in Outlook 2007 that saves each attachment on an email and imports
it to our document repository system. However, I need to remove spaces in the file name because if the file path string with embedded spaces is passed to the import program, it thinks each space delimits a new file name. I need to get the 8.3 format of the file path string. Here is what I have currently: For Each objMsg In objSelection ' This code only strips attachments from mail items. If objMsg.Class = olMail Then ' Get the Attachments collection of the item. Set objAttachments = objMsg.Attachments lngCount = objAttachments.Count If lngCount 0 Then ' We need to use a count down loop for ' removing items from a collection. Otherwise, ' the loop counter gets confused and only every ' other item is removed. For i = lngCount To 1 Step -1 ' Save attachment before deleting from item. ' Get the file name. strfile = objAttachments.Item(i).FileName ' Combine with the path to the Temp folder. strfile = strFolder & strfile ' Save the attachment as a file. objAttachments.Item(i).SaveAsFile strfile ' Delete the attachment. 'objAttachments.Item(i).Delete ExecCmd "ttimport.exe " & app & " " & strfile Next i End If objMsg.Save End If Next I know that I need to put something in here to shorten the file name, but I'm not sure where and how. Any help is appreciated. Thanks! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Import XP .pst file to Outlook 2003 .pst error = File access d | EZ2LUVME | Outlook - Installation | 1 | June 1st 08 11:51 AM |
trying to export .aba file from Palm Desktop to .csv file and havingproblems with irregular characters | Joe | Outlook - General Queries | 1 | May 4th 08 04:18 PM |
PRF file problem wiht personal folders data file password protecte | Groupex1 | Outlook - Installation | 0 | November 1st 07 08:01 PM |
Outlook file translators stuck on a default data file or not worki | Charles griffiths | Outlook - Using Contacts | 2 | April 23rd 07 11:50 AM |
excel file type missing from import a file window in outlook | xanadufl | Outlook - Using Contacts | 9 | February 28th 06 09:55 AM |