• Creator
    Topic
  • #4265
    WolfJ
    Participant

      Hallo,

      I am a newbie in programing VB and Formativ. I am normaly programing with Delphi – now I try the Formativstudio but I have a bit of a Problem understanding some functions not working. Could you help me and tell me why this doesen’t work:

      Sub Main(Client, GWEvent)
      Dim AdressBuecher
      Dim AdressBuch

      Set AdressBuecher = GroupWise.AddressBooks
      set AdressBuch = AdressBuecher.Item(“TTT”)

      AdressBuch.Delete()
      End Sub

      I tested 2 houres around with this and have no idea!

      Thanks if you would help me.

    • Author
      Replies
    • #7655
      Support 1
      Participant

        Thank you for your enquiry.

        Can you provide more information about how the code does not work? For example, does it fail on the line:

          set AdressBuch = AdressBuecher.Item("TTT")

        or on the line:

          AdressBuch.Delete()

        Is an error message displayed? What is your installed version of GroupWise?

        You could try something like the following to confirm the name of the address book you wish to delete:

        '-------------------------------------------------------------------------------
        Sub Main(Client, GWEvent)
        
          dim iText
          dim oBooks
          dim oBook
        
          iText = ""
        
          set oBooks = GroupWise.AddressBooks
          for each oBook in oBooks
            iText = iText & oBook.Name & vbNewLine
          next
          set oBooks = nothing
        
          MsgBox iText, , "Address Book Names"
        
        End Sub
        '-------------------------------------------------------------------------------

        I hope this helps.

        Regards,
        Advansys Support

        [This message was edited by Support 1 on June 27, 2006 at 10:04 PM.]

        #7656
        WolfJ
        Participant

          Thank you for your quick resonance.
          I tried your example and everything works OK. If I run the “deletecommand” nothing happens (not even an error message).

          Our Groupwiseversion is 6.5.3.

          Regards J. Wolf

          #7660
          Support 1
          Participant

            J. Wolf,

            The following applet sample (using the native GroupWise AddressBooks object) should do what you require:

            Sub Main(Client, GWEvent)
              dim AdressBuecher
              dim AdressBuch
            
              set AdressBuecher = GroupWise.Account.AddressBooks
              set AdressBuch = AdressBuecher.Item("TTT")
            
              AdressBuch.Delete()
            
            End Sub

            You may find that the Address Book application continues to show TTT – however it should be empty. When you restart Address Book/GroupWise, TTT should not be there.

            Background

            Your original code uses the AddressBooks object which is ‘wrapped’ by Formativ, not the native GroupWise AddressBooks object. The wrapped object is provided in order to make it simpler to access fields. For more information, see the Formativ Language Guide, under GroupWise -> AddressBooks. I will add an entry to the Formativ enhancements database, to implement the wrapped AddressBook.Delete() method.

            I hope this helps.

            Regards,
            Advansys Support

            #7657
            WolfJ
            Participant

              Thank you for your answer, but even if you restart Groupwise the Adreessbook will show up – only if you start the “addrbook.exe” the book isn’t there anymore.
              I only don’t know now how to go on – is the Book deleted or not?

              #7659
              Support 1
              Participant

                You are correct. The Address Book application (addrbook.exe) must be restarted before the book is removed completely. Closing GroupWise will automatically close addrbook.exe.

                However, you should find that after executing the code, the applet (or any other software) will not be able to access the deleted address book – even if addrbook.exe is still running.

                Regards,
                Advansys Support

                #7658
                WolfJ
                Participant

                  Thank’s for your answer

                  #7661
                  Support 1
                  Participant

                    You are most welcome.

                    Regards,
                    Advansys Support

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