+ Reply to Thread
Results 1 to 9 of 9

Maximize programs called from Userform

  1. #1
    Registered User
    Join Date
    01-18-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    12

    Maximize programs called from Userform

    Hi,
    I have a fairly complex Userform that transfers data to Word via the Word Bookmarks. This runs great, perfect actually... my only issue is that once the Word document is generated from the Userform, it stays minimized on the taskbar... is there a way via VBA to make this Word Document full sized so the end user does not have to click on it in the taskbar to see it?
    Hope that makes sense...

  2. #2
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Maximize programs called from Userform

    Generally, a bit of code such as the following pulls up the Word document. (In this case, I'm assuming that the variable for the Word object is oWord. Change it to suit).

    Please Login or Register  to view this content.
    Let me know if this works

  3. #3
    Registered User
    Join Date
    01-18-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Maximize programs called from Userform

    Quote Originally Posted by BigBas View Post
    Generally, a bit of code such as the following pulls up the Word document. (In this case, I'm assuming that the variable for the Word object is oWord. Change it to suit).

    Please Login or Register  to view this content.
    Let me know if this works
    Thanks BigBas but this is giving me a run time error '438' Object doesn't support this property or method

  4. #4
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Maximize programs called from Userform

    How are you creating/referencing the Word object? Can you post some of your code?

    I just created a quick mock-up example, and using the code I pasted above worked for me.

  5. #5
    Registered User
    Join Date
    01-18-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Maximize programs called from Userform

    BigBas,
    I am a fool, I did not explain this right.. the Word doc actually does come up but is obscured behind the Userform... so I tried a me.hide then put the code snippet in to launch the word document followed by a me.visible. The issue with this is that the form hides, I see a flash of the Word document then the Userform comes back in front to obscure the Word doc once again....

    Quote Originally Posted by BigBas View Post
    How are you creating/referencing the Word object? Can you post some of your code?

    I just created a quick mock-up example, and using the code I pasted above worked for me.

  6. #6
    Registered User
    Join Date
    01-18-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Maximize programs called from Userform

    to add to this, once a user prints the Word doc, I really do need the focus to return back to the Userform..
    Thank you sooooo much

  7. #7
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Maximize programs called from Userform

    If I'm not mistaken, you don't need to do all this. I'm going to post my sample code just to give an example. A userform is open on the screen. When I click on the userform, an instance of Word is created, and it is populated with a text string. The Word document takes focus, and the form is in the background. There is no reason to hide then show the form because it is still open behind the Word document.

    Theoretically, you could print the Word document from within the VBA code, then close it.

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    01-18-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Maximize programs called from Userform

    PERFECT!!!!
    Thank you sooooo much!!!

  9. #9
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Maximize programs called from Userform

    Not a problem!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Add Maximize button to userform
    By Mamud in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-04-2014, 08:39 AM
  2. [SOLVED] Userform code fails when the userform is called from a custom ribbon button
    By klonbeck in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-14-2013, 03:00 PM
  3. [SOLVED] Userform called from another userform textbox - unload problem
    By barryleajo in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-27-2013, 01:09 PM
  4. Replies: 14
    Last Post: 10-04-2012, 05:19 PM
  5. Maximize and Minimize the Userform
    By yeshwant_sur in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-19-2012, 06:27 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1