/ Forums / Advansys Formativ / Creating Solutions with Formativ / Spell Check on External Items

  • Creator
    Topic
  • #4074
    stuartcross
    Participant

    We have recently implemented a policy on emails to force the spell check to run when a user sends any emails. We have implemented this so that any emails to clients do not have spelling errors. As a law firm this is quite important. The downside to this is that we do not neccessarily want the spell check to run on internal emails. We have had quite a few complaints about the spell check running all the time. As a result we would like to create an applet which can be executed with the ‘On Send’ event. This applet should check if the address sending to is an external account and if so should bring up the spell checker. I am able to test the email address, I have just been unable to find how to start the spell checker.

    Is this possible to do with Advansys?

    Thanks,

    Stuart

  • Author
    Replies
  • #7021
    Support 1a
    Participant

    Stuart,

    Try

    dim iReturnVal
    call groupwise.throwtoken("Speller(0)", iReturnVal)
    

    That should work for you.

    Regards,

    Advansys Support

    #7018
    stuartcross
    Participant

    Thanks for that. I still have a problem though. I have created the following applet:

    Dim Recipient

    Sub Main(Client, GWEvent)
    Recipient = Groupwise.ItemGetText(“X00”, itfTo)
    If (Instr(1, Recipient, “@”, 1) > 0) Then
    If (Instr(1, Recipient, “shlegal.com”, 1) = 0) then
    dim iReturnVal
    call groupwise.throwtoken(“Speller(0)”, iReturnVal)
    End If
    End If
    End Sub

    This seems to work with checking that the email is for external people, however it brings up the spelcheck and then immediatley sends the email without actually performing the check. Is there anyway to force it to perform the spell check before it sends the mail?

    Thanks,

    Stuart

    #7017
    Support 1a
    Participant

    Stuart,

    It seems the GroupWise speller runs in its own thread. This means the process doesn’t wait until the speller process is done. This is why the applet continues, and the message is sent, before the speller has a chance to complete.

    The only work around I can think of that doesn’t involve Novell changing the way the speller works is to put the applet in a loop that simply processes the windows message loop until the speller process is done. I’ve done this in the example code below by looking for the Writing Tools window.

    Please note this code requires a little more robustness to be built in, and has not been extensively tested.

    Dim Recipient
    
    Sub Main(Client, GWEvent)
       Recipient = Groupwise.ItemGetText("X00", itfTo)
       If (Instr(1, Recipient, "@", 1) > 0) Then
         If (Instr(1, Recipient, "shlegal.com", 1) = 0) then
           dim iReturnVal
           call groupwise.throwtoken("Speller(0)", iReturnVal)
    
           ' Speller runs in a different thread, so we need to wait until
           ' the speller is done before returning.
           dim iSpellerWindow
           Utilities.DoEvents
           iSpellerWindow = utilities.FindWindow("" , "Writing Tools")
           while iSpellerWindow <> 0
             Utilities.DoEvents
             iSpellerWindow = utilities.FindWindow("" , "Writing Tools")
           wend
           MsgBox "Speller Done"
          End If
       End If
    End Sub

    I hope this helps,

    Advansys Support

    #7016
    stuartcross
    Participant

    I have just tested the applet out on my PC and it seems to work. Will need to do a bit more testing to make sure of no problems.

    I was also thinking, is it possible to set the ‘Check spelling before send’ option from within an applet. If so then I would like to set up the applet so that if it recognises the email as an external mail then it will set this check box before it sends the mail. If it see’s that it is an internal mail it can switch this off before it sends it.

    Thanks,

    Stuart

    #7019
    Support 1a
    Participant

    Unfortunately I don’t think this settings is exposed, either to read or write.

    Regards,

    Advansys Support

    #7020
    stuartcross
    Participant

    Have just been doing some more testing on this applet and have given it to a few users. They have noticed a problem with it. If they select an external address from their address book it will not run the spell check. I have done some tests and notice that the Groupwise.ItemGetText(“X00”, itfTo) only returns the Address book entry name and not the actual email address. This then causes problems because I am unable to use the test for the ‘@’ symbol to see if it external.

    Is there anyway to get the actual email address that it is being sent to rather than the address book entry name?

    Hope this makes sense

    Stuart

    #7022
    Support 1
    Participant

    Stuart,

    The address book entry name must be resolved to an email address. See the following code sample for a guide on how to do this.

    '-----------------------------------------------------------  
      dim iRecipient
    
      iRecipient = GroupWise.ItemGetText("X00", itfTo)
    
      ' @ symbol is missing, we need to resolve the address
      if (InStr(1, iRecipient, "@", vbTextCompare) = 0) then
    
        ' Get the full email address of a name or resource.
    
        iRecipient = GroupWise.AddressBookResolveFullName(iRecipient, "")
    
        ' Make sure recipient is an external user, check domain name
        if (InStr(1, iRecipient, "novell.com", vbTextCompare) = 0) then
          MsgBox "External Recipient"
        end if
     
      end if
    '-----------------------------------------------------------
    

    I hope this helps you.

    Advansys Support

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