D
donchanger
Is there a way to set the focus to a control on a built-in form in VBA? I
have a macro attached to a button that does a simple substitution in my
signature, but it only works if the "body" of the message has the focus when
I click the button (I'm using SendKeys with a search and replace).
Since the form is "built-in", there is no ModifiedFormPages. Is there a way
to set the focus? Maybe even just a keyboard shortcut?
Thanks for any help or suggestions,
Don
Code Snip:
Sub SrchRepl(Srch, Repl)
'search the message body for the first occurrence of 'srch' and replace
with 'repl'
'need to set the focus in the body (control "message") on the form
SendKeys "{F4}"
SendKeys Srch
SendKeys "{ENTER}"
SendKeys "%{F4}", True
SendKeys Repl, True
End Sub
have a macro attached to a button that does a simple substitution in my
signature, but it only works if the "body" of the message has the focus when
I click the button (I'm using SendKeys with a search and replace).
Since the form is "built-in", there is no ModifiedFormPages. Is there a way
to set the focus? Maybe even just a keyboard shortcut?
Thanks for any help or suggestions,
Don
Code Snip:
Sub SrchRepl(Srch, Repl)
'search the message body for the first occurrence of 'srch' and replace
with 'repl'
'need to set the focus in the body (control "message") on the form
SendKeys "{F4}"
SendKeys Srch
SendKeys "{ENTER}"
SendKeys "%{F4}", True
SendKeys Repl, True
End Sub