Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Feb 2001
    Location
    Denver, Colorado, USA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Autoexec and Userform

    Using Word 2000. Could someone provide some info about using an Autoexec macro and a Userform? I'd like to start Word and have an Autoexec macro run, display a Userform, gather a few parameters from the Userform. When the user clicks OK, I will write those values to a text file and Word should exit.

    Thanks,

    =====Keith

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Autoexec and Userform

    Hi Keith,

    You should be able to use an AutoExec macro to display a userform that will collect information from the user.

    But if you make Word exit when they click OK, doesn't that mean that they can never use the Word application for any other purpose?

    Gary

  3. #3
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Autoexec and Userform

    I'm with Gary, I wouldn't go hijacking Word completely but you could put something like this into a template where FormUF is the name of the user form embedded in it.
    <pre>Sub AutoNew()
    FormUF.Show
    FormUF.Hide
    Unload FormUF
    End Sub</pre>

    Andrew Lockton, Chrysalis Design, Melbourne Australia

  4. #4
    New Lounger
    Join Date
    Feb 2001
    Location
    Denver, Colorado, USA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Autoexec and Userform

    Thanks - I wanted to use Word in order to provide a form without resorting to a VB .EXE - since everyone has Office 2000 here at work.

    I wanted it to display the form and look as little like Word as possible. I will try a few ideas, and maybe come back with a few more questions.

    Thanks for the replies.

    ====Keith

  5. #5
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Autoexec and Userform

    Hi Keith,

    (a useful suggestion this time <g>)
    You could start by having your userform take up most or all of the screen. Give it a white background rather than the standard gray.

    There's a fair amount that can be done with the limited tools available for building userforms, to simulate a simple application. By using frames or multipage controls you can allow the user to cycle through various screen views, for instance.

    Gary

  6. #6
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Autoexec and Userform

    You could hide the Word application by using
    Application.WindowState = wdWindowStateMinimize

    Of course the user will still see the Word splash screen etc unless you hide that with startup switches. I have never played with Words startup switches but I am pretty sure it can be done.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  7. #7
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Autoexec and Userform

    Keith,

    You might be limiting yourself by this approach.

    You would only need a single copy of VB- that shouldn't cost too much. You can achieve a lot more with VB as a standalone, and you would probably get a good performance benefit as well.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

Posting Permissions

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