Email attachment when someone else has it open

N

nockam

I have windows task scheduler setup to run some VBS code for me to send
out some reports automatically ever night for me. However some people
have started to figure out if they leave the file open the report will
not send. I have looked all over and cannot figure out how to do this.
Can anyone tell me what I need to do in order to make it so that if
someone has the file opened it will still send the attachment?



Set objemail = CreateObject("CDO.Message")
objemail.From = "(e-mail address removed)"
objemail.To = "(e-mail address removed)"
objemail.cc = "(e-mail address removed)"
objemail.Subject = "Subject"
objemail.Textbody = "Body"
objemail.AddAttachment "file path"
objemail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objemail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"mailserver.domain.com"
objemail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") =
25
objemail.Configuration.Fields.Update
objemail.Send
 
R

Ron de Bruin

If you can control the file ?
If the file is open use SaveCopyAs to save a copy and send that one
 
C

Crowbar via OfficeKB.com

Can you try giving it a different file name

That way it shouldn't intefere
 

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

Similar Threads

Shutdown script doesn't work 4
Send a Table with Filters. HELP! 3
Macro email 4
Script 2
Add attachment to CDO email 1
Email Using CDO - mixed results 7
Problem in mail attachment when using CDO 3
Excel CDO 5

Top