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
A VBscript stops running after updating form Outlook VBA and Custom Forms 1
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
kburrows Outlook Classic - JPG files are corrupted when opened or saved Using Outlook 3
F Sync Outlook Calendar Using Outlook 0
G Change default font size in sticky notes - Outlook Desktop 2021 Using Outlook 2
C VBA in "New Outlook?" Using Outlook 0
D New Outlook with Business Basic Plans Using Outlook 0
D Outlook 2021 not working with Outlook 2003 installed Using Outlook 5
D Outlook 2003 stopped working - get they dialog box asking for username & Password Using Outlook 2
T Outlook 2021 hangs in close on taskbar occasionally Using Outlook 1
M Duplicate removal feature in Outlook 2021 is faulty Using Outlook 2
D.Moore Outlook COM addins source folder Using Outlook 11
P Removing Outlook 365 Account from Send/Receive Using Outlook 3
kburrows Outlook Automatically Merging Contacts Using Outlook 2
A Outlook 2016 Outlook 2016 vs. New Outlook Using Outlook 4
D Outlook Desktop App Email Software Using Outlook 0
efire9207 VBA Outlook Contacts Outlook VBA and Custom Forms 6
M Outlook not logging in to server Using Outlook 0
J Outlook macro to run before email is being send Outlook VBA and Custom Forms 0
R Outlook 2021 change view Using Outlook 2
K Outlook font corrupted in some point sizes, resets on close/open Using Outlook 2
J Is the Windows Outlook Tasks module really going to be gone? Using Outlook 6
F Outlook 2010 and Hotmail Using Outlook 1
A Outlook 2021 needs 'enter' for people search Using Outlook 2
HarvMan Outlook 365 Inbox Font Using Outlook 8
Retired Geek Outlook on MAC delete duplicate Sent emails Using Outlook 0
S New Outlook - IMAP ISSUES and support for addins? Using Outlook 1
C outlook.com fonts Using Outlook 2

Similar threads

Back
Top