H
hlock
If an email has a .msg attachment, I need to save it off as an .rtf
attachment. Is there a way to do this?
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
Dim path As String
' Get the file name.
strfile = objAttachments.Item(i).FileName
'Check filename of attachment to see if .msg
If Right(strfile, 3) = "msg" Then
strfile = Replace(strfile, " ", "_")
strfile = strfile & ".rtf"
path = fso.BuildPath(tempdir, strfile)
objAttachments.Item.SaveAsFile path, olRTF
ExecCmd "ttimport.exe " & app & " " & strfile
Else
strfile = Replace(strfile, " ", "_")
'Combine with the path to the Temp folder.
strfile = tempdir & strfile
' Save the attachment as a file.
objAttachments.Item(i).SaveAsFile strfile
ExecCmd "ttimport.exe " & app & " " & strfile
End If
Next i
End If
Thanks!!
attachment. Is there a way to do this?
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
Dim path As String
' Get the file name.
strfile = objAttachments.Item(i).FileName
'Check filename of attachment to see if .msg
If Right(strfile, 3) = "msg" Then
strfile = Replace(strfile, " ", "_")
strfile = strfile & ".rtf"
path = fso.BuildPath(tempdir, strfile)
objAttachments.Item.SaveAsFile path, olRTF
ExecCmd "ttimport.exe " & app & " " & strfile
Else
strfile = Replace(strfile, " ", "_")
'Combine with the path to the Temp folder.
strfile = tempdir & strfile
' Save the attachment as a file.
objAttachments.Item(i).SaveAsFile strfile
ExecCmd "ttimport.exe " & app & " " & strfile
End If
Next i
End If
Thanks!!