Solved

VB Script in Outlook 2010 opens programs minimized

Posted on 2014-02-20
5
278 Views
Last Modified: 2014-02-21
Hello,

I have script that opens Word and other programs.  They always open in a minimized state.  I've set Word to always open maximized but it doesn't work.

Any ideas?  Here's my code.
Joel

Private Function GetWordDocLabelHold(strTemplatePath)
    On Error Resume Next
    m_blnWeOpenedWord = False
    Set objWord2 = GetObject(, "Word.Application")
    If objWord2 Is Nothing Then
        Set objWord2 = CreateObject("Word.Application")
        m_blnWeOpenedWord = True
   End If
    m_blnWordPrintBackground = _
      objWord2.Options.PrintBackground
    If strTemplatePath = "" Then
        strTemplatePath = "\\TGPS13VM1\drawing$\Jobs\Task_Templates\Normal.dot"
   End If
   objWord2.Visible = True
    Set GetWordDocLabelHold = objWord2.Documents.Add(strTemplatePath)

End Function
0
Comment
Question by:Genius123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 15

Expert Comment

by:DrTribos
ID: 39875535
Something like this might help...
application.Windows(1).WindowState = wdWindowStateMaximize

Open in new window

0
 

Author Comment

by:Genius123
ID: 39877600
Thanks.  It's not quite working.  Do I need to define it as a constant?  Here's another one I use.  If so, do you know what the value would be?

Const wdDoNotSaveChanges = 0
0
 
LVL 15

Accepted Solution

by:
DrTribos earned 500 total points
ID: 39878014
Well I can confirm the constant is 1
(wdWindowStateMaximize = 1)

Hope that helps

From where is your script running?
0
 

Author Closing Comment

by:Genius123
ID: 39878026
That worked!  Thanks!
0
 
LVL 15

Expert Comment

by:DrTribos
ID: 39878066
Fantastic glad it helped :-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.

691 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