Thank you for your question below. Unfortunately, the GroupWise.Enter() and other positioning commands are all direct encapsulations of the native GroupWise positioning functions. In other words, we have no direct control over what they do.
That being said, this family of command is particularly sensitive to focus. You mentioned you call GroupWise.FocusSet(), which is generally sufficient. However, under some environments, you need to take other steps to ensure the focus is correct.
For example, something we have done in the past is to call GroupWise.FocusSet, then sit in a loop, checking which control actually does have the focus, only breaking out when you have confirmed focus. It can also be a good idea to call Utilities.DoEvents() inside the loop to ensure you don’t block the GroupWise windows messages, which can also be a cause of strange timing problems. (It’s also a good idea to break out of the loop after some pre-determined time so that you don’t end up in an infinite loop).
Another approach would be to build your header in a variable, including formatting such as hard returns, etc, and insert the entire contents at once instead of manually calling discrete formatting/text writing commands.
Finally, you may have come across a problem with the GroupWise client itself. What version of the GroupWise client are you experiencing the problem on? Does it happen on plain text messages, HTML messages or both?
I would also be happy to take a quick look at your applet to see if there are any obvious issues. Feel free to email it to firstname.lastname@example.org.
I hope this information helps.