/ Forums / Advansys Formativ / Creating Solutions with Formativ / Formatting and Positioning Output Text

  • Creator
  • #4073

    We have an applet that inserts a header into the message body of every message before it is sent. For reasons unknown, Groupwise occassionally ignores the carriage return statement “GroupWise.Enter()” and appends multiple lines of text on the same line. This is random and I can’t seem to duplicate the error with consistency.

    It also sometimes ignores positioning statements and inserts the text in the wrong place.

    I’ve tried using GroupWise.FocusSet(fcsMessage, “”) statements to ensure the focus is in the message body prior to calling the position functions, but it seems to have no effect and we are still seeing this problem.

    This has been an ongoing issue and we are getting desperate for solutions, as some of our clients’ mail filters are rejecting our mail due to invalid message headers.

    Is there a fix for this in Formativ 2.0? When will this new version of Formativ be ready for use in a production environment?

    Any help or suggestions would be appreciated.

  • Author
  • #7011
    Support 1a

    Dear Iaabelle,

    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 support@advansyscorp.com.

    I hope this information helps.

    Advansys Support


    We are using GroupWise client version 6.5.2B
    We have disabled HTML, and so the problems are with text messages only.

    I will try to implement some of your suggested solutions.

    Thanks for you help,

    Support 1a

    Thanks for the update. Please let us know if you require any further assistance.

    Advansys Support


    2 questions:

    1. I am trying to format my header text by building it inside a variable and including hard returns, instead of using Groupwise.Enter(). How do I indicate a hard return inside a string?

    ie. what is the equivalent to the escape character “n”?

    Here’s a sample of what I’m trying to do:

    headerText = variable1 & “n” & variable2 & “n”.

    2. When looping to check which control has focus, what is the command for retrieving the focus state of a control? More specifically, how do I know when the message body has focus?

    Could you provide a code sample on how to implement such a loop?

    Much appreciated,

    Support 1a


    You can use the standand VB constant ‘vbcrlf’ to insert a CR/LF pair in a string. You’ll find this constant (and some others) documented in the VBS help file.

    Here’s some examples of using this technique. They vary based on whether you are working with plain text or HTML messages.

    Plain Text:

    headerText = variable1 & vbcrlf & variable2 & vbcrlf
    call GroupWise.FocusSet(fcsMessage, "") 


    headerText = variable1 & "<BR>" & variable2 & "<BR>"
    call GroupWise.FocusSet(fcsMessage, "") 

    In terms of querying the focus, I’m afraid I’ve accidentally misled you. I was thinking of querying the current view or window. Unfortunately, GroupWise does not provide a means by which you can query control focus. Please accept my apologies. What you could try is something like this:

    if GroupWise.EnvCurrentViewName() = "Mail" then
       call GroupWise.FocusSet(fcsMessage, "")
       MsgBox "The mail view is not active - FocusSet will not work just yet."
    end if

    Without knowing the exact context in which you are accessing the body (I would need to see the applet), this is the general approach you can use, i.e. check that the view is active (and possibly activate it) prior to attempting to call any FocusSet() methods.

    I hope this helps.

    Advansys Support

    [This message was edited by Support 3 on September 07, 2004 at 04:58 PM.]

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.