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

  • Creator
  • #4025

      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?


    • Author
    • #6885
      Support 1

        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
                iIndex = iIndex + 1
              end if
            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)
                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.