Email attachment name 
Author Message
 Email attachment name


have written code similar to the following.
The email gets created and can be sent OK. The attachment is given the right
name and shows up with the correct descriptive name at the receiver's end.
But when the recipient wants to save the attachment, he can only do so by
right-clicking and selecting Save As. In that case, the original file name
is kept and the filetype is recognized.
My question is : what do I need to change for the receiver to be able to
select "Save attachment" from the File menu. When doing this now, the
filename changes to something like "C:\Windows\temp\att12345.tmp", and also
looses the original filename and the application needed to open this type of

Any suggestions ?

Code :

    Dim cdoSession As Session
    Set cdoSession = New Session                                ' create new
    With cdoSession
        .Logon , , True, False
        Dim cdoMessage As Message
        Set cdoMessage = .Outbox.Messages.Add
' create new message
        With cdoMessage
            .Subject = "Subject"
' subject line
            .Text = "Bodytext"
' bodytext
            Dim cdoattach1 As Attachment
            Set cdoattach1 = .Attachments.Add
' create new attachment
            With cdoattach1
                .Type = CdoFileData
' filetype = data
                .Name = UCase(txtFileName) + ".dat"
' descriptive name of attachment
                .Position = Len(cdoMessage.Text) + 1
' place at end of bodytext
                .ReadFromFile OutputPath + "\" + UCase(txtFileName) + ".dat"
' actual filepath
            End With
            Dim cdoRecip As Recipient
' create recipient
            Set cdoRecip = .Recipients.Add
            With cdoRecip
' fill in details for ...
                .Name = EmailTo
' ... recipient
                .Type = CdoTo
' make him a "To" recipient
                .Resolve True
' ensure valid address
            End With
            .Update                                             ' send the
            .Send showDialog:=False                             ' do not
show email
        End With
        .Logoff                                                 ' close
    End With

Tue, 11 May 2004 21:49:55 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Email Attachment NAME property... changes once delivered???

2. Email File Attachment Display Name Length???

3. add name of attachment to Subject line and delete attachment

4. Sending Email with Default Email Software WITH Attachment

5. More than one attachment in auto Email problem

6. email function with attachments -- new error

7. email function with attachments

8. Emailing an attachment???

9. Emailing with an attachment from Access VBA

10. use VBA send a snapshot type report out as an attachment of an email

11. Auotmate email file attachment (upload) and send - help?

12. Automate Email .csv attachments


Powered by phpBB® Forum Software