Help needed with code for saving file as attachment.

gtvkeith

Board Regular
Joined
Mar 15, 2006
Messages
78
Hi everyone,

I am working on an OH&S induction form, that all staff at my work must complete. The file is to be opened from our "Intranet" from any PC on site.

What I want to do is have the Macro "change" the filename from "Employee Induction" to be the same as the Subject line in the code below, without saving the file to the local PC.

I.e. I want the file to be sent as (saved as) an attachment with the same filename as the subject line for the e-mail.

Can this be done without saving the file locally first?

Code:
Sub SendInductionForm()

Dim TESTSurnameCAPS As String, TESTName As String

ActiveDocument.SendForReview _
        Recipients:=("gtvgatehouse@nine.com.au"), _
        Subject:=TESTSurnameCAPS & " " & TESTName & " - XXX Employee Induction - " & AutoDate
        
End Sub

I am using Excell 2003.

Thanks..

Keith.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Here is what you need to do.

1) Change the file name. Save it.
2) Mail the form to yourself.
3) Delete the file from the system. So there is no local copy.

Are you sure this is what you want?
 
Upvote 0
Firstly, I need to offer my apologies to nirvana for the ridiculously long time it has taken me to reply to his post, I have been tied up on other projects for the last couple of months.

Unfortunately this solution will not help me, I have had to run with using a generic filename instead. I ended up using a "flag" on the file to count how many time it had been opened.

Each time it is opened a new set of macros is run- one of which renames the file after it has been received at its destination. It's a work-around but it works.

But thankyou very much nirvana for taking the time to try and help.

Keith.
 
Upvote 0

Forum statistics

Threads
1,214,873
Messages
6,122,029
Members
449,061
Latest member
TheRealJoaquin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top