/ Forums / Advansys Formativ / Creating Solutions with Formativ / Force GroupWise to open the application for an attachment

  • Creator
    Topic
  • #4025
    Anonymous

    Hi all,

    I need to force groupwise to open an attachment with the application is is associated to, rather then viewing this in the GroupWise viewer. The user must not be able to change this behaviour. Can I use Formativ to achive this and if yes, how?

    thanks

  • Author
    Replies
  • #6885
    Support 1
    Participant

    Formativ can be used to open a file attachment using the Windows file association, as shown in the applet example below. This example should be launched from a toolbar button on an open message view.

    ' GroupWise integrations should include the toolbar for all required message
    ' types.  Note that setting this integration will require restarting GroupWise.
    sub Main(Client, GWEvent)
    
      dim iFileName
      dim iFound
      dim iIndex
      dim oAttachment
      dim oMsg
    
      set oMsg = Client.ClientState.CommandMessage
      if IsObject(oMsg) then
        iFound = false
        iIndex = 1
        do while (iIndex <= oMsg.Attachments.Count) and (not iFound)
          if oMsg.Attachments(iIndex).ObjType = fgwFile then
            iFound = true
          else
            iIndex = iIndex + 1
          end if
        loop
    
        if iFound then
          set oAttachment = oMsg.Attachments(iIndex)
          iFileName = oAttachment.FileName
          if iFileName <> "" then
            iFileName = Utilities.TempFiles & iFileName
            call oAttachment.Save(iFileName)
            call Utilities.OpenDocument(iFileName)
          else
            iFound = false
          end if
          set oAttachment = nothing
        end if
    
        if not iFound then
          call MsgBox("Cannot find a file attachment.", vbInformation, "Open Document")
        end if
      end if
    
      set oMsg = nothing
    
    end sub

    I hope this helps.

    Advansys Support

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