Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jan 2002
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Custom contact form, Save options (2002)

    Hi everyone, I have a question about a contact form I'm designing. What I would like to do is have two buttons on the form that Save the contact in one of two public folders. An example would be a button that saves the contact to a folder called Store 1 and another button that would save to a folder called Store 2. I'm not sure how the save function works on a button.
    I either need to be able to do this or change the way the Save and Close button works on the existing form so that it could pop up a seperate form that asks which folder I would like to save to.
    Has anyone done this before? Any help or direction on where to look would be greatly appreciated. Thanks!

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Custom contact form, Save options (2002)

    When a toolbar button is pressed, it generates an event that can be intercepted with VBA (sample, in the context of Word, in <!post=Post #92036,92036>Post #92036<!/post>). However, I don't believe that VBA can be stored with the form. Instead, it typically is stored in a single file called VbaProject.otm, so this makes your solution difficult to distribute. You might have better luck creating your own buttons (although I have no idea how or whether it is possible to do this).

  3. #3
    Lounger
    Join Date
    Feb 2001
    Location
    London UK, Gtr London, England
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Custom contact form, Save options (2002)

    You can add VBscript to the form that fires when you click the button
    e.g
    Sub Button1_Click()
    item.move (myfolder)
    item.save
    <font color=448800>you will need a lot more than this!</font color=448800>
    end sub

    or you could capture the item_close event to fire your code
    However, saying that, for a similar task I used VBAProject.otm, and added a button to the tool bar which would move an item and save it
    Sub File()
    On Error GoTo errh
    Set inbox = Application.GetNamespace("MAPI").GetDefaultFolder( olFolderInbox)
    Set imItem = Application.ActiveInspector.CurrentItem
    imItem.move inbox.Folders("Filing")
    imitem.save
    GoTo ends
    errh:
    res = MsgBox("Cannot move item", 48, "Microsoft Outlook")
    ends:
    End Sub


    Hope this makes sence and is of use

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •