/ Forums / Advansys Formativ / Creating Solutions with Formativ / Want to use Formativ to update my signature – anything special required?

  • Creator
    Topic
  • #4322
    dgerisch
    Participant

    One of my co-workers suggested a little project, and I like the idea, so I’m going to try it out. However, I’m having trouble at step 1.

    The idea is that I’d like to update my GroupWise signature with a line that reports how many spam messages were blocked yesterday. I get an email avery morning that gives me the number, all I need now is to pluck that number out of the message, and write it into my signature line.

    Here is what I have so far:


    Sub Main(Client, GWEvent)

    dim Sig1
    dim Sig2
    dim Sig3

    dim QtySpamBlocked

    dim SignatureTextString

    QtySpamBlocked = "bazillion"

    Sig1 = "David Gerisch, Systems Technician"
    Sig2 = "A.C.S. / Tulare County Information Technology"
    Sig3 = "Yesterday, we blocked " & QtySpamBlocked & " spam messages."

    SignatureTextString = Sig1 & HRT & Sig2 & HRT & Sig3

    Call GroupWise.PrefSignature( incPrompt, true, true, SignatureTextString )

    End Sub

    It runs without error, but it doesn’t update the signature line.

    Can someone tell me what I am missing?

    Thanks!

  • Author
    Replies
  • #7819
    Support 3
    Participant

    Use ThrowToken to execute a token. See the Formativ Language guide for more information. ThrowToken uses the native GroupWise Token Commander to execute the given token. See the URL for the Token API: http://developer.novell.com/documentation/gwtoken/index.html?gwtokens/data/hj8ej8g5.html

    I have noticed the default GroupWise signature (Tools – Options – Environment – Signature) need to be enabled for this token to work. See below the sample code.

      
     dim iReturnValue
     dim iSyntax
    
     QtySpamBlocked = 3
     Sig1 = "David Gerisch, Systems Technician"
     Sig2 = "A.C.S. / Tulare County Information Technology"
     Sig3 = "Yesterday, we blocked " & QtySpamBlocked & " spam messages."
    
     SignatureTextString = Sig1 & HRT & Sig2 & HRT & Sig3
    
     iSyntax = "PrefSignature(1;0;0;""" & SignatureTextString & """;"""";"""";"""")"
     msgbox groupwise.throwtoken(iSyntax, iReturnValue)
    

    Hope this help. Look forward to hear from you.

    Regards,
    Advansys Support

    [This message was edited by Support 3 on February 13, 2007 at 03:27 PM.]

    #7818
    dgerisch
    Participant

    Thank you for the info – it helped me figure out why my original program wasn’t working.

    As it turns out, both programs work if I delete my existing signature first. If I do not, then no update happens.

    The token throwing version is nice in that the msgbox tells me the return value is true; the code did what it was supposed to. The error must be further down the line, what with running into an existing signature, and not just wholesale replacing it.

    #7817
    dgerisch
    Participant

    One other question:

    the string I’m sending it is getting stripped of linefeed / carriage return characters. What is the correct way to send those through?

    Thanks!

    #7820
    Support 3
    Participant

    The following Visual Basic constants copied from the Visual Basic Scripting Guide. See the guide for more information.

    quote:


    Microsoft® Visual Basic® Scripting Edition
    String Constants Language Reference
    Version 2

    Since these constants are built into VBScript, you don’t have to define them before using them. Use them anywhere in your code to represent the values shown for each.

    Constant – Value – Description
    vbCr – Chr(13) – Carriage return.
    vbCrLf – Chr(13) & Chr(10) – Carriage return–linefeed combination.
    vbFormFeed – Chr(12) – Form feed; not useful in Microsoft Windows.
    vbLf – Chr(10) – Line feed.
    vbNewLine – Chr(13) & Chr(10) or Chr(10) – Platform-specific newline character; whatever is appropriate for the platform.
    vbNullChar – Chr(0) – Character having the value 0.
    vbNullString – String having value 0 – Not the same as a zero-length string (“”); used for calling external procedures.
    vbTab – Chr(9) – Horizontal tab.
    vbVerticalTab – Chr(11) – Vertical tab; not useful in Microsoft Windows.


    Regards,
    Advansys Support

    #7816
    dgerisch
    Participant

    Thank you very much. Smile

    Do you know if the inability to replace an existing signature is “working as designed” ?

    #7815
    Support 3
    Participant

    3rd party developer unable to edit the default GroupWise signature using the Object/Token API. Documentaion in the SOAP API says, you can edit signature.

    GroupWise Web Service (SOAP): http://developer.novell.com/wiki/index.php/GroupWise_Web_Service_(SOAP)

    Regards,
    Advansys Support

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