Change the name of an exported object

I

IT

Hello,

When you export a report to an email using sendobject it takes the name of
that report as the name of that attachement. Is it possible to change then
name of the attachment to something else?
I am using Access 2003

Cheers
 
T

Tom Wickerath

You can set the report's caption programmatically, during the activate event procedure. If you
then export the report as a snapshot file, the filename will be the caption plus the .snp
extension. I haven't tested it on any other type of export (other than snapshot), but I suspect
that it would work the same for exporting to RTF, for example.

Here is code that I use to accomplish this task:

Private Sub Report_Activate()
On Error GoTo ProcError
' The caption is used for the Snapshot filename (caption.snp)
Me.Caption = strServiceRequested & " Request for " & strBoeingEquipID
DoCmd.Maximize
ExitProc:
Exit Sub
ProcError:
MsgBox "Error: " & Err.Number & ". " & Err.Description, , _
"Error in Report_Activate event procedure..."
Resume ExitProc
End Sub


Tom
______________________________________________


Hello,

When you export a report to an email using sendobject it takes the name of
that report as the name of that attachement. Is it possible to change then
name of the attachment to something else?
I am using Access 2003

Cheers
 
T

Tom Wickerath

PS. I forgot to add that the two variables shown below, strServiceRequested and
strBoeingEquipID, are fields that are printed in my report. These values are supplied by the
query that serves as the report's recordsource.

Tom
______________________________________________


You can set the report's caption programmatically, during the activate event procedure. If you
then export the report as a snapshot file, the filename will be the caption plus the .snp
extension. I haven't tested it on any other type of export (other than snapshot), but I suspect
that it would work the same for exporting to RTF, for example.

Here is code that I use to accomplish this task:

Private Sub Report_Activate()
On Error GoTo ProcError
' The caption is used for the Snapshot filename (caption.snp)
Me.Caption = strServiceRequested & " Request for " & strBoeingEquipID
DoCmd.Maximize
ExitProc:
Exit Sub
ProcError:
MsgBox "Error: " & Err.Number & ". " & Err.Description, , _
"Error in Report_Activate event procedure..."
Resume ExitProc
End Sub


Tom
______________________________________________


Hello,

When you export a report to an email using sendobject it takes the name of
that report as the name of that attachement. Is it possible to change then
name of the attachment to something else?
I am using Access 2003

Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top