Genius123
asked on
VB Script in Outlook 2010 opens programs minimized
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(strTem platePath)
On Error Resume Next
m_blnWeOpenedWord = False
Set objWord2 = GetObject(, "Word.Application")
If objWord2 Is Nothing Then
Set objWord2 = CreateObject("Word.Applica tion")
m_blnWeOpenedWord = True
End If
m_blnWordPrintBackground = _
objWord2.Options.PrintBack ground
If strTemplatePath = "" Then
strTemplatePath = "\\TGPS13VM1\drawing$\Jobs \Task_Temp lates\Norm al.dot"
End If
objWord2.Visible = True
Set GetWordDocLabelHold = objWord2.Documents.Add(str TemplatePa th)
End Function
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(strTem
On Error Resume Next
m_blnWeOpenedWord = False
Set objWord2 = GetObject(, "Word.Application")
If objWord2 Is Nothing Then
Set objWord2 = CreateObject("Word.Applica
m_blnWeOpenedWord = True
End If
m_blnWordPrintBackground = _
objWord2.Options.PrintBack
If strTemplatePath = "" Then
strTemplatePath = "\\TGPS13VM1\drawing$\Jobs
End If
objWord2.Visible = True
Set GetWordDocLabelHold = objWord2.Documents.Add(str
End Function
ASKER
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
Const wdDoNotSaveChanges = 0
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That worked! Thanks!
Fantastic glad it helped :-)
Open in new window