/ Forums / Advansys Formativ / Creating Solutions with Formativ / Same code – different results

  • Creator
    Topic
  • #4345
    rstarr
    Participant

    We have an applet which gathers data from the AddressBook and inserts a “signature block” into an e-mail. Here is the insertion code:

    If (GWEvent = “GW#C#COMPOSE” or GWEvent = “GW#C#FORWARD”) then
    Call GroupWise.FocusSet(10, “”)
    GroupWise.PosTextTop
    GroupWise.TypeText(Chr(10) & Chr(10) & FullName)
    GroupWise.TypeText(Chr(10) & Title)
    GroupWise.TypeText(Chr(10) & CompanyName)
    GroupWise.TypeText(Chr(10) & Street)
    GroupWise.TypeText(Chr(10) & City & “, ” & State & ” ” & Zip)
    GroupWise.TypeText(Chr(10) & “Phone: ” & Phone)
    GroupWise.TypeText(Chr(10) & “Fax: ” & FaxNum)
    GroupWise.TypeText(Chr(10) & “Email: ” & LCase(Email))
    GroupWise.TypeText(Chr(10) & “Website: ” & Website)
    Groupwise.Enter()
    GroupWise.PosTextTop
    Call GroupWise.FocusSet(0, “”)

    Elseif (GWEvent = “GW#C#REPLY”) then
    Call GroupWise.FocusSet(10, “”)
    GroupWise.PosTextTop
    GroupWise.TypeText(Chr(10) & Chr(10) & FullName)
    GroupWise.TypeText(Chr(10) & Title)
    GroupWise.TypeText(Chr(10) & CompanyName)
    GroupWise.TypeText(Chr(10) & Street)
    GroupWise.TypeText(Chr(10) & City & “, ” & State & ” ” & Zip)
    GroupWise.TypeText(Chr(10) & “Phone: ” & Phone)
    GroupWise.TypeText(Chr(10) & “Fax: ” & FaxNum)
    GroupWise.TypeText(Chr(10) & “Email: ” & LCase(Email))
    GroupWise.TypeText(Chr(10) & “Website: ” & Website)
    Groupwise.Enter()
    GroupWise.PosTextTop
    Else
    Call MsgBox(“No GroupWise message was found for signature insertion.”, 64, CAPTION)
    End If

    When the GroupWise default compose view is set to plain text, the block inserts correctly as in:
    My name
    My Title
    Company Name
    Blah, blah, blah

    However, when the default compose view is set to HTML, the block inserts as above ONLY when replying. When composing or replying the block inserts as follows:
    My name

    My Title
    Company Name
    Blah, blah, blah

    NOTE the extra line break between My name and My Title. Any ideas how to make this not happen?

  • Author
    Replies
  • #7874
    Support 3
    Participant

    “Chr(10)” returns a linefeed character, “Chr(13)” returns a carriage return character. The two-character string Chr(13) & Chr(10) returns a Windows newline. Alternatively you can use the Visual Basic String Constants vbCrlf which return carriage return–linefeed combination. See the Visual Basic Scripting Guide for more information (GroupWise Help – Formativ Help – vbscript).

      
      Call GroupWise.FocusSet(10, "")
      GroupWise.PosTextTop
      GroupWise.TypeText(vbcrlf & FullName)
      GroupWise.TypeText(vbcrlf & Title)
      GroupWise.TypeText(vbcrlf & CompanyName)
      GroupWise.TypeText(vbcrlf & Street)
      GroupWise.TypeText(vbcrlf & City & ", " & State & " " & Zip)
      GroupWise.TypeText(vbcrlf & "Phone: " & Phone)
      GroupWise.TypeText(vbcrlf & "Fax: " & FaxNum)
      GroupWise.TypeText(vbcrlf & "Email: " & LCase(Email))
      GroupWise.TypeText(vbcrlf & "Website: " & Website)
      Groupwise.Enter()
      GroupWise.PosTextTop
    

    Regards,
    Advansys Support

    #7871
    rstarr
    Participant

    I tried each of the various options which you suggested and came up with the same results, i.e. whenever there is a new window, such as in composing a new mail or as in forwarding as an attachment then I get an extra line break between the FullName and Title. Otherwise I get no extra line break between FullName and Title. This only happens in compose view is HTML. Various users compose in Plain Text and others in HTML so I need a solution which will work for all. Can you duplicate the problem? Suggest a solution? Thanks for whatever you can offer.

    #7873
    Support 3
    Participant

    We are unable to re-produce the behaviour you described above with the code below. No line break inserted between FullName and Title in HTML or Plain text view. The behaviour is the same in composing new message, reply or forwarded message.

    We are using GroupWise 7.0.2 (06/04/2007). Which version of the GroupWise client you are using? If you are using the earlier version of the GroupWise client then you may need to try against latest version.

      
    const FullName = "Bill Smith"
    const Title = "Softwarer Engineer"
    const CompanyName = "Novell"
    const Street = "Pitt Street"
    const City = "Sydney"
    const State = "NSW"
    const Zip = "2566"
    const Phone = "9999999"
    const FaxNum = "8888888"
    const Email1 = "bill@domain.com"
    const Website = "www.advansyscorp.com"
    
    '-------------------------------------------------------------------------------
    ' Mainline processing
    '-------------------------------------------------------------------------------
    
    Sub Main(Client, GWEvent)
      If (GWEvent = "GW#C#COMPOSE" or GWEvent = "GW#C#FORWARD") then
        InsertSignature()
        Call GroupWise.FocusSet(0, "")
      Elseif (GWEvent = "GW#C#REPLY") then
        InsertSignature()
      Else
        Call MsgBox("No GroupWise message was found for signature insertion.", 64, CAPTION)
      End If
    End Sub
    
    
    ' Insert Signature
    sub InsertSignature()
      Call GroupWise.FocusSet(10, "")
      GroupWise.PosTextTop
      GroupWise.TypeText(vbcrlf & FullName)
      GroupWise.TypeText(vbcrlf & Title)
      GroupWise.TypeText(vbcrlf & CompanyName)
      GroupWise.TypeText(vbcrlf & Street)
      GroupWise.TypeText(vbcrlf & City & ", " & State & " " & Zip)
      GroupWise.TypeText(vbcrlf & "Phone: " & Phone)
      GroupWise.TypeText(vbcrlf & "Fax: " & FaxNum)
      GroupWise.TypeText(vbcrlf & "Email: " & LCase(Email1))
      GroupWise.TypeText(vbcrlf & "Website: " & Website)
      Groupwise.Enter()
      GroupWise.PosTextTop
    end sub
    

    Regards,
    Advansys Support

    #7870
    Support 1
    Participant

    When manually composing an HTML-format message, GroupWise translates the [Enter] key into the <BR> HTML tag. This suggests the following approach for both plain-text and HTML: does it work when you use this code?

      
      Call GroupWise.FocusSet(10, "")
      GroupWise.PosTextTop
      GroupWise.Enter
      GroupWise.TypeText(FullName)
      GroupWise.Enter
      GroupWise.TypeText(Title)
      GroupWise.Enter
      GroupWise.TypeText(CompanyName)
      GroupWise.Enter
      GroupWise.TypeText(Street)
      GroupWise.Enter
      GroupWise.TypeText(City & ", " & State & " " & Zip)
      GroupWise.Enter
      GroupWise.TypeText("Phone: " & Phone)
      GroupWise.Enter
      GroupWise.TypeText("Fax: " & FaxNum)
      GroupWise.Enter
      GroupWise.TypeText("Email: " & LCase(Email))
      GroupWise.Enter
      GroupWise.TypeText("Website: " & Website)
      Groupwise.Enter
      GroupWise.PosTextTop

    Regards,
    Advansys Support

    #7875
    rstarr
    Participant

    Using GroupWise.Enter instead of Chr(10)or vbcrlf appears to have fixed this strange problem. Thank you.

    #7872
    Support 1
    Participant

    I’m pleased about your result and thank you for the confirmation.

    Regards,
    Advansys Support

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