Mo-ra
New Member
- OS Version(s)
- Windows
- Outlook version
- Outlook 365 64 bit
- Email Account
- Office 365 Exchange
Operating system:: Windows 11
Outlook version: 365
Email type or host: Microsoft 365
Outlook version: 365
Email type or host: Microsoft 365
Hello all,
I have no real knowledge of VBA code and have attempted to find a piece of code online that would automatically attaches a pdf file (from a specific directory) based on file name in the subject heading but have had no luck. For example the file name is "19353424.ABCDEF.pdf". The subject line will only contain the following "Account Ref 19353424". Occasionally there may be more than one file with "19353424.ABCDEF.pdf" so automatically attaching multiple attachments would be ideal.
I have attempted something like this but no luck :
I have no real knowledge of VBA code and have attempted to find a piece of code online that would automatically attaches a pdf file (from a specific directory) based on file name in the subject heading but have had no luck. For example the file name is "19353424.ABCDEF.pdf". The subject line will only contain the following "Account Ref 19353424". Occasionally there may be more than one file with "19353424.ABCDEF.pdf" so automatically attaching multiple attachments would be ideal.
I have attempted something like this but no luck :
VBA attach pdf based on subject line
Update## This is what i have got from the suggestions so far. Im lost as all hell... Sub Attach() Set objOutlookMgs = Application.ActiveInspector.CurrentItem Dim Subject As String Sub...
stackoverflow.com