locked
Word VBA: open one form from another RRS feed

  • Question

  • I am trying to get back to developing in Word, but I have forgotten some very basic techniques.

    I have created three forms using the VBA editor in Word.

    I want to place a button on the bottom of the first form that will take the user to the next form depending on some answers on the first form. Later, I want to be able to pull information from both forms when the document if ultimately printed.  I just cannot find the commands that within word.  Hate taking up peoples time with simple stuff

    • Moved by Mike Feng Monday, September 19, 2011 10:55 AM VBA (From:Visual Basic General)
    Friday, September 16, 2011 12:00 AM

Answers

  • Deleted
    • Proposed as answer by Mike Feng Monday, September 19, 2011 10:55 AM
    • Marked as answer by danishani Tuesday, February 7, 2012 8:04 PM
    Friday, September 16, 2011 12:02 AM
  • Hi gherman,

     

    Below article gives you a nice example on how to build UserForm in combination with Bookmarks.

    The technique is using the UserForm to fill the entries and they will be shown in the Bookmarks in your Word Document.

     

    http://www.fontstuff.com/vba/vbatut09pfv.htm

     

    To open another Form based on an entry, see below example, in either the Change or AfterUpdate event of TextBox1 on UserForm1:

    Private Sub TextBox1_Change()
    
    Select Case TextBox1.Value
    
    Case "test"
    
    UserForm2.Show
    
    Case Else
    ' do nothing
    
    End Select
    
    
    End Sub
    
    

    Hope this helps,

     


    Daniel van den Berg | Washington, USA | "Anticipate the difficult by managing the easy"
    • Proposed as answer by danishani Wednesday, February 1, 2012 4:38 PM
    • Marked as answer by danishani Tuesday, February 7, 2012 8:04 PM
    Wednesday, February 1, 2012 4:37 PM

All replies

  • Hi gherman,

     

    Below article gives you a nice example on how to build UserForm in combination with Bookmarks.

    The technique is using the UserForm to fill the entries and they will be shown in the Bookmarks in your Word Document.

     

    http://www.fontstuff.com/vba/vbatut09pfv.htm

     

    To open another Form based on an entry, see below example, in either the Change or AfterUpdate event of TextBox1 on UserForm1:

    Private Sub TextBox1_Change()
    
    Select Case TextBox1.Value
    
    Case "test"
    
    UserForm2.Show
    
    Case Else
    ' do nothing
    
    End Select
    
    
    End Sub
    
    

    Hope this helps,

     


    Daniel van den Berg | Washington, USA | "Anticipate the difficult by managing the easy"
    • Proposed as answer by danishani Wednesday, February 1, 2012 4:38 PM
    • Marked as answer by danishani Tuesday, February 7, 2012 8:04 PM
    Wednesday, February 1, 2012 4:37 PM