Word 2016 Using Sendkeys in Autoopen

Bobby Jennings 1 Reputation point
2021-07-11T18:19:50.687+00:00

I would like to send a string to a word document when it opens.
But, sendkeys does not seem to work.

Here is my code.
Sub AutoOpen()
Application.GoBack
Selection.MoveDown Unit:=wdLine, Count:=10
Selection.MoveUp Unit:=wdLine, Count:=10
Call NavPaneSearch
SendKeys "Hi Mom"
End Sub

This should send "Hi Mom" to the newly open document, but it doesn't do it.

What will make this work?
Thanks!

{count} votes