The function LatestFile works in either Outlook VBA and Word VBA to give you the last file in any named folder.
You have said that you are creating a message from Word using VBA. The logical place to add the file is therefore to add the attachment using the macro that you use to create the message.
If you want to add it to the open message from Outlook, then the Word macro must first have completed, and as you seem reluctant to post that macro code, it is not possible to determine that is the case.
If that macro has finished, the following Outlook macro will add the last file from the named folder to the open message
Sub AddLatestFile()
'Graham Mayor - https://www.gmayor.com - Last updated - 28 May 2020
Dim olMsg As MailItem
On Error Resume Next
Select Case Outlook.Application.ActiveWindow.Class
Case olInspector
Set olMsg = ActiveInspector.currentItem
Case olExplorer
Set olMsg = Application.ActiveExplorer.Selection.Item(1)
End Select
olMsg.Attachments.Add LatestFile("C:\path\folder\") 'Change the path as appropriate
lbl_Exit:
Exit Sub
End Sub
Private Function LatestFile(strFolder As String, _
Optional strFilespec As String = "*.*") As String
Dim strName As String
Dim strRecent As String
Dim dDate As Date
Do Until Right(strFolder, 1) = Chr(92)
strFolder = strFolder & Chr(92)
Loop
strName = Dir(strFolder & strFilespec)
If strName <> "" Then
strRecent = strName
dDate = FileDateTime(strFolder & strName)
Do While strName <> ""
If FileDateTime(strFolder & strName) > dDate Then
strRecent = strName
dDate = FileDateTime(strFolder & strName)
End If
strName = Dir
Loop
End If
LatestFile = strFolder & strRecent
End Function