Solved

word (office 2010) coming up minimised when called from another program on windows 7 but not on xp

Posted on 2013-12-09
4
217 Views
Last Modified: 2014-01-20
Hi

I have a curious problem, Word 2010 when called from a vb6  program using create object is being displayed minimised, even though explicitly in the program it set to maximised.

When the Word 2003 is called from the VB6 program on Windows XP using create object Word correctly comes up maximised.

Whats the problem on Windows 7!
0
Comment
Question by:capitaldev
  • 2
  • 2
4 Comments
 
LVL 42

Expert Comment

by:pcelba
ID: 39705851
Word 2003 and 2010 are two rather different programs... with rather different behaviour.

How do you recognize the Word is minimized? Isn't it just placed behind other windows? What happens when you set WindowState = 2 and then WindowState = 1 ?

Could you post some piece of code?
0
 

Author Comment

by:capitaldev
ID: 39706054
Its sits on the task bar flashing.




The code we use is

Set mvarApp = CreateObject("Word.Application")
mvarApp.WindowState = 2


Tried WindowState =2,  AND windowState = 1 both seem to be minimised.

However a collegue of mind thinks that the word documents are behind the program running.

Is there a way to get word to always display on top of the program running.
0
 
LVL 42

Accepted Solution

by:
pcelba earned 500 total points
ID: 39706092
This code should work:

Set mvarApp = CreateObject("Word.Application")
mvarApp.Visible = True    ...   Hope this is right VB syntax
mvarApp.WindowState = 2
mvarApp.WindowState = 1
0
 

Author Closing Comment

by:capitaldev
ID: 39793807
Thanks for the answer. Sorry it took so long to get back to you.  Also found a way of doing it without altering the code namely A registy hack i.e

In the HKEY_Current_User hive, then the Control Panel section followed by the Desktop sub section

Then edit the value of the key ForegroundLockTimeout from 30d40 to 0.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
My experience with Windows 10 over a one year period and suggestions for smooth operation
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question