Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Jan 2003
    Location
    Fort Worth, Texas, USA
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA newbie needs help (Word XP)

    I have created a template, and am using InputBoxes to gather information to be plugged into the document. At one point the user will have to make a decision as to whether a document was recorded in a Volume/Page or a Transaction. I have created a UserForm with 2 radio buttons allowing the user to choose one or the other. After they choose, I need to do an If

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA newbie needs help (Word XP)

    Gwyne,
    Back up a bit...

    Since you are wisely choosing a userform for user input, you can lose the rather boring (and inept) InputBox function. Prompt for those values with textboxes (and labels) on your userform. With all prompted fields on a userform you can use the Query_close event to supply bullet-proof validation for your form -- which is where your If..then goes.

    if rdoVolumePage = true then
    transNumber = 23
    else
    transNumber = 15
    endif

    I don't know, but that's what I think...
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  4. #3
    New Lounger
    Join Date
    Jan 2003
    Location
    Fort Worth, Texas, USA
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA newbie needs help (Word XP)

    Thanks for your help, Kevin.

    I work with 135 VERY brain-dead users. They want to see the template so they will know what goes in the "little gray box" (shaded form field). The first couple of templates I created used UserForms. Alas....they are used to WP 5.1 macros and the InputBoxes are as close as I can get to what they are used to. (Don't scare the people with something new).

    I may be able to use part of your code... See if this is correct:

    if rdoVolumePage = true then
    strVolume = InputBox("Enter The Volume Number.")
    strPage = InputBox("Enter The Page Number.")
    else
    strTransNum = InputBox("Enter the Transaction Number")
    endif

    If the IF...Else... statement above is correct, how do I get the UserForm to open AND open at the right place???

    <img src=/S/crossfingers.gif border=0 alt=crossfingers width=17 height=16>

  5. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA newbie needs help (Word XP)

    Our stories sound quite similar. We migraged from 400+ WP 5.1 macros to a userform-based Office (mostly Word)-based app. Maybe you'll wean them one day...

    Anyway, the userform displays with

    frmThePartiallyScaryForm.Show

    Set the location with the property "StartupPosition"

    I'm not clear from your post where exactly in the code you want to show the form.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  6. #5
    New Lounger
    Join Date
    Jan 2003
    Location
    Fort Worth, Texas, USA
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA newbie needs help (Word XP)

    Wean them

  7. #6
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA newbie needs help (Word XP)

    Have you created the userform yet? If not, create that puppy in the VBE (VB Editor). If you are a really really new B, better look here first.

    The userform has a bunch of properties you set to make the thing look less scary for your users. You know, things like colours, size, scrollbars, etc. One of those properties is called StartupPosition. You'll find it. When you do, click on the property name then press F1 to get the MS skinny on what it does and how to use it.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  8. #7
    New Lounger
    Join Date
    Jan 2003
    Location
    Fort Worth, Texas, USA
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA newbie needs help (Word XP)

    Thanks very much, Kevin. Your site was one of the first things I downloaded and tried when I got stuck with this project. You've been a great help with my questions. I'm sure I'll have plenty more before I convert 200+ WP 5.1 macros to Word. Thanks again.

Posting Permissions

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