Add post button to an Outlook form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bsonnek
    New Member
    • Oct 2007
    • 2

    #1

    Add post button to an Outlook form

    I am creating a form in Outlook. I need a command button to post the form. What do i need between this to have it "Post" (Ctrl+Enter). all i need is for it is to do that key combination.

    Private Sub CommandButton1_ Click()

    ctrl+enter

    End Sub

    Thank you in advance!
  • mrnn
    New Member
    • Sep 2007
    • 29

    #2
    Originally posted by bsonnek
    I am creating a form in Outlook. I need a command button to post the form. What do i need between this to have it "Post" (Ctrl+Enter). all i need is for it is to do that key combination.

    Private Sub CommandButton1_ Click()

    ctrl+enter

    End Sub

    Thank you in advance!
    outlook? is that visual basic? :P

    well i'd use this, there's probably an easier way but i know how to do it at least :P and this is how it'd be on vb6, but i'm sure its similar with other versions

    (In General Declarations)
    Dim a, b as Boolean


    Private Sub Form1_KeyDown(K eyCode as Integer) 'each key on the keyboard has its own code number

    If KeyCode = (whatever it is for ctrl, sorry i dont know it off the top of my head...u can find it out easily by makin a program with this code in Form_KeyDown and makin a label control named label1 -Label1.caption = KeyCode-)
    a = true
    end if

    if keycode = (whatever it is for Enter) then
    b = true
    end if

    if a = true then
    if b = true then
    'post the form 'all this checks to see if both a and b are true
    end if
    end if

    (also in KeyUp have the same thing but instead of equaling true, have them equal false so theyre only true when the buttons are pressed)

    hope this helps yah :)

    Comment

    • bsonnek
      New Member
      • Oct 2007
      • 2

      #3
      Originally posted by mrnn
      outlook? is that visual basic? :P

      well i'd use this, there's probably an easier way but i know how to do it at least :P and this is how it'd be on vb6, but i'm sure its similar with other versions

      (In General Declarations)
      Dim a, b as Boolean


      Private Sub Form1_KeyDown(K eyCode as Integer) 'each key on the keyboard has its own code number

      If KeyCode = (whatever it is for ctrl, sorry i dont know it off the top of my head...u can find it out easily by makin a program with this code in Form_KeyDown and makin a label control named label1 -Label1.caption = KeyCode-)
      a = true
      end if

      if keycode = (whatever it is for Enter) then
      b = true
      end if

      if a = true then
      if b = true then
      'post the form 'all this checks to see if both a and b are true
      end if
      end if

      (also in KeyUp have the same thing but instead of equaling true, have them equal false so theyre only true when the buttons are pressed)

      hope this helps yah :)
      Thank you! I'll give it try.

      Comment

      Working...