• Creator
    Topic
  • #4027
    Anonymous

    This is related to my previous topic on not triggering the onsend event when posting a task.

    I am using the sample code which Marco has provided:(thanks Marco)

    posted January 28, 2004 03:55 AM
    I’m using this code as a workaround:

    Set Msg = GroupWise.ComposingItem
    if (Msg.ClassName = “GW.MESSAGE.TASK”) then
    if (Msg.BoxType = 3) then
    ‘ msgbox (“posted task”)
    exit sub
    end if
    end if

    This works great for me, but when we distributed this code to some of our clients it did not work. For some reason Msg.BoxType returns 2 on some workstations and 3 on others. We are opening the exact same window by selecting posted task but it is returning a 2 on some workstations and 3 on others.

  • Author
    Replies
  • #6890
    Marco
    Participant

    I’m using GW 6.5.1 and had never seen this before.

    Are you sure using the same window (posted task)
    and not an outgoing task send to your self?

    If you send a task with TO, CC or BCC to your self
    you will get the “2” (outgoing) instead of the
    “3” for posted tasks. This is correct, I think.

    #6888
    Support 1
    Participant

    The object returned by GroupWise.ComposingItem is not a fully initialized Message object.
    Formally, the BoxType property is undefined. I suggest using the following approach to determine whether the open message being composed is a personal task.

    Sub Main(Client, GWEvent)
    
      dim iPersonal
      dim oMsg
    
      set oMsg = GroupWise.ComposingItem
      if not (oMsg is nothing) then
        iPersonal = (oMsg.ClassName = "GW.MESSAGE.TASK") _
          and GroupWise.ItemGetAttribute("X00", 198)
    
        msgbox "ClassName: " & oMsg.ClassName & ", Personal: " & iPersonal
      end if
    
    End Sub

    Note that “X00” identifies the current composing message, which does not yet have a defined message ID.

    Advansys Support

    #6887
    Anonymous

    I tried your code and again it worked fine for me, but when one of my collegues tried it we found it was not working. When selecting a post task option the code correctly returns personal:true for me. But when my collegue tries to post task it returns a personal:false for him. He then tried to select the view directly from the ofviewswinvs02mls1.vew directory and it worked! It returned personal:true. We are using groupwise 6.5 sp2
    I can’t understand why this is not working on his machine?

    #6889
    Support 1
    Participant

    An alternative approach you could try is based on the GroupWise token ItemGetSource:

    const SRC_MAILBOX = 1
    const SRC_SENT_ITEMS = 2
    const SRC_PERSONAL = 3
    
    Sub Main(Client, GWEvent)
    
      dim iPersonal
      dim oMsg
    
      set oMsg = GroupWise.ComposingItem
      if not (oMsg is nothing) then
        iPersonal = (oMsg.ClassName = "GW.MESSAGE.TASK") _
          and (GroupWise.ItemGetSource("X00") = SRC_PERSONAL)
    
        msgbox "ClassName: " & oMsg.ClassName & ", Personal: " & iPersonal
      end if
    
    End Sub

    It may be that there is a defect in the GroupWise client (or in your co-worker’s installation), causing it to report the box type/message source in error.

    In addition, it may be that your co-worker’s local copy of the relevant view has been edited in some way that alters the type reported by GroupWise. Perhaps you can experiment with replacing that view with your own ‘working’ view file. If you wish, send us the view file to analyze, at support@advansyscorp.com.

    Advansys Support

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