VBScript Outlook, add attachment

Status
Not open for further replies.

kpoole

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server 2013
I have been working on several different vbscript codes to figure out my issues but to prevail. The macro is suppose to search a folder path then choose to correct file name and attach it to the outgoing email. Below is the part of the script I am having difficulty with. For some reason it keeps telling me Not found and I can't come up with a resolution. Also the "New Name" is written because everyday a new file is added for reports. (Ex: Kimrad Dispatch 08-22-2014.xlsx)

Sub SendAttachment()

Dim SOURCE_FOLDER As String
Dim NewName As String

SOURCE_FOLDER = "K:\Dispatch folder\High Sierra Dispatch Sheets\"
NewName = "Kimrad Dispatch " & Format("d", "mm-dd-yyyy") & " South" & ".xlsx"
Dim fileName As String
fileName = Dir(SOURCE_FOLDER & NewName)
If fileName = "" Then
MsgBox "Not found"
Exit Sub
End If
End Sub

PS, I this script code is just to see if it can find the file. (The rest of it doesn't matter if it can't even find it) Any suggestions would be greatly appreciated.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
J Outlook 2010 VBScript editor does not run code at all Outlook VBA and Custom Forms 0
B Recommended Outlook & VBScript Books? Outlook VBA and Custom Forms 3
H Accessing a control on a frame in Outlook with VBScript Outlook VBA and Custom Forms 1
N VBScript does not run in Outlook 2003 Outlook VBA and Custom Forms 4
B VBScript doesn't run on Recipient Email Outlook VBA and Custom Forms 2
M VbScript for Command Button on Contacts Custom Form Using Outlook 1
M Forward Appointment as BCC with VBScript Outlook VBA and Custom Forms 7
D Security patch seems to kill vbscript on Enterprise Level Outlook VBA and Custom Forms 4
R VBScript Commands Outlook VBA and Custom Forms 2
Mark White VBScript Move sent mail to non-default folder Outlook VBA and Custom Forms 5
Mark White VBScript Move sent mail to non-default folder Outlook VBA and Custom Forms 0
S my vbscript button1_click code works on appointment created but not on opening an existing apntmn Outlook VBA and Custom Forms 16
JorgeDario Template oft that contains VBScript Is not running Using Outlook 1
T Create new item in public folder using VBscript Outlook VBA and Custom Forms 1
R VBScript Sendmail not selecting correct 'from' address Outlook VBA and Custom Forms 3
Mary B VBscript: Need to copy every email to a folder & mark that copy as read Outlook VBA and Custom Forms 5
S VBA Macro to VBScript Outlook VBA and Custom Forms 1
E VBScript to replace module? Using Outlook 3
F VBScript to add pre defined text Using Outlook 5
D Custom form and VBScript Using Outlook 5
F VBScript copy contacts and remove duplicates Using Outlook 1
R VBA Macro to VBScript in a form- Help Please! Using Outlook 10
Y Creating a Task with VBScript Outlook VBA and Custom Forms 14
I Outlook 2003 shows html code when To: field is empty Using Outlook 5
O The Outlook API wrongfully shows an outlook folder to have zero sub-folders Outlook VBA and Custom Forms 1
O The Outlook API wrongfully shows an outlook folder to have zero sub-folders Outlook VBA and Custom Forms 2
C All Gmails don't show in Outlook 2019 Using Outlook 0
D Outlook 2007 vs. Outlook 2010 -- ToDo Bar Using Outlook 0
U Outlook 2016 Outlook 2016 sender name Using Outlook 1
T Compuserve, Yahoo, Oath2 and Outlook 2013 Using Outlook 4
E Work uses live accounts for emails for all employees. Can we use the outlook calendar to give the employees an universal work schedule calendar? Using Outlook 1
witzker Macro to move @domain.xx of a Spammail to Blacklist in Outlook 2019 Outlook VBA and Custom Forms 4
D Outlook 2007 on 365 Using Outlook.com accounts in Outlook 2
S Macro for other actions - Outlook 2007 Outlook VBA and Custom Forms 18
P outlook 2008 search box criteria couldn't be saved Using Outlook 2
pcunite Outlook 2019/O365 Build 13127.20408 errors when using MAPI calls Using Outlook 1
C Outlook with Office365 - search across account, by date rate, in multiple folders - how? Using Outlook 1
D Outlook 2010 Outlook in Windows 10 keeps asking for user name and password repeatedly Using Outlook 14
S Outlook mail adressing stops after first match in GAL Using Outlook 0
A Apply Selected Emails to outlook rules and Run Rules Using Outlook 5
T Changing Sent Items location in Outlook 2019 Using Outlook 0
J How do I disable advertising in Outlook 2019? Using Outlook 13
S Outlook (2016 32bit; Gmail IMAP) - Save sent message to Outllook Folder Outlook VBA and Custom Forms 0
L Unable to Sync Web/Android MS To Do with Windows Outlook Tasks Using Outlook 3
S Macro to move “Re:” & “FWD:” email recieved the shared inbox to a subfolder in outlook Outlook VBA and Custom Forms 0
S Outlook Macro to send auto acknowledge mail only to new mails received to a specific shared inbox Outlook VBA and Custom Forms 0
S Outlook Macro to move reply mail based on the key word in the subjectline Outlook VBA and Custom Forms 0
B Outlook Calendar not coming down from cloud Using Outlook 2
Terry Sullivan Sender's Name Doesn't Appear in the From Field on Outlook 365/IMAP Using Outlook 2
GregS Outlook 2016 Can I disable the Outlook Outbox? Using Outlook 2

Similar threads

Top