/ Forums / Advansys Formativ / Creating Solutions with Formativ / Newbie Question – How to select all mails in specific folder?

  • Creator
    Topic
  • #4370
    MSchatz
    Participant

      Hi all,

      I searched the docs, crawled the examples and looked in the forums. Haven’t found what I’m looking for: Simulate the “Select All” menu entry.

      Thanks for any hint

      M. Schatz

    • Author
      Replies
    • #7957
      Support 3
      Participant

        If you want to access all messages in a given folder then try the following code. Note that, you have to use bit different technique when accessing the messages in Mailbox folder. Mailbox folder usually contains the sent messages which you can not see in client.

          
          dim oFolder
          dim oMessages
        
          set oFolder = client.clientstate.selectedfolder
        
          if (oFolder.ObjType = fgwMailbox) then
            set oMessages = oFolder.messages.find("(BOX_TYPE=INCOMING)")
            msgbox oMessages.count
            set oMessages = nothing
          else
            msgbox oFolder.Messages.count
          end if
        
          set oFolder = nothing
        

        Regards,
        Advansys Support

        #7959
        MSchatz
        Participant

          Thanks a lot for your quick response. It solved my problem.

          I was looking for a way to archive all items in selected folder, so selecting “Mailbox” is not allowed. For anyone looking here, I post some of my additions to your code:

           
            dim oFolder
            dim oMessages
          
            set oFolder = client.clientstate.selectedfolder
          
            if (oFolder.ObjType <> fgwMailbox) then
              set oMessages = oFolder.Messages
              for each Message in oMessages
                Message.Archived = true
              next
              set oMessages = nothing
            else
              msgbox "Not allowed here."
            end if
          
            set oFolder = nothing
          

          In real life, you would wrap some code around like status dialog a.s.o.

          BTW, as a longterm delphi programmer I am somewhat spoiled with code-completion and in-depth documentation. Are there any chances to get at least one of them into Formativ? I see there are a lot of documentation, but it is a bit complicated to find, what you are looking for.

          Regards,
          M. Schatz

          #7958
          Support 3
          Participant

            Thanks for your feedback and sample code.

            The code-completion which is in our roadmap. We also have plan to extend further to support plug-in where developer can write the solution in other platform (i.e VS, Delphi, etc). As you know, it will require extensive R&D work. Currently we are occupied with making Formativ to Vista compatibility.

            Regards,
            Advansys Support

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