Two things:
1- Solution finds "DIA1" within the last line, it doesn't check the last word. If you insist on the last word here it is:
Sub Lastword()
Dim rng As Range, wrd As String
Set rng = ActiveDocument.Paragraphs.Last.Range
wrd = StrReverse(Trim(Left(StrReverse(rng), InStr(1, StrReverse(rng), " ", vbTextCompare))))
MsgBox wrd
End Sub
2- F9-F12 are reserved so your closest option is F8. Alternatively you can assign macro to F9 by following these steps, as @Ibo suggested.
Solution:
1-Bind F8 to your macro
Sub Bind()
Application.CustomizationContext = ThisDocument.AttachedTemplate
KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyF8), KeyCategory:=wdKeyCategoryMacro, Command:="Runme"
End Sub
2- "Find and replace" macro:
Sub Runme()
Dim rng As Range
Set rng = ActiveDocument.Paragraphs.Last.Range
rng.Find.Execute FindText:="DIA1", ReplaceWith:="hello", Replace:=wdReplaceAll
End Sub
3-If you need to unbind F8:
Sub Unbind()
CustomizationContext = NormalTemplate
FindKey(BuildKeyCode(wdKeyF8)).Clear
End Sub