DougRobertson
Active Member
- Joined
- Sep 22, 2009
- Messages
- 334
- Office Version
- 365
- Platform
- Windows
Hello,
I use a macro to generate emails for various reports I send, but I want to have the email window show up in a specific place on the screen - in 'normal' mode.
Here's the code I'm trying to accomplish it with. The screen-sizing section works when using a macro to resize excel windows, but not Outlook email windows.
Sub Macro1()
'
' Macro1 Macro
'
Set otlApp = CreateObject("Outlook.Application")
Set otlNewMail = otlApp.CreateItem(otlMailItem)
With otlNewMail
.To = "YOU"
.Subject = "BROADCAST ANALYSIS REPORT"
.Body = Chr(14) & "Hello Everyone!"
.Display
.Application.ActiveWindow.WindowState = 2
With ActiveWindow
.Top = 3
.Left = 2.2
.Width = 600
.Height = 300
End With
End With
End Sub
Thanks in advance,
~ Doug
I use a macro to generate emails for various reports I send, but I want to have the email window show up in a specific place on the screen - in 'normal' mode.
Here's the code I'm trying to accomplish it with. The screen-sizing section works when using a macro to resize excel windows, but not Outlook email windows.
Sub Macro1()
'
' Macro1 Macro
'
Set otlApp = CreateObject("Outlook.Application")
Set otlNewMail = otlApp.CreateItem(otlMailItem)
With otlNewMail
.To = "YOU"
.Subject = "BROADCAST ANALYSIS REPORT"
.Body = Chr(14) & "Hello Everyone!"
.Display
.Application.ActiveWindow.WindowState = 2
With ActiveWindow
.Top = 3
.Left = 2.2
.Width = 600
.Height = 300
End With
End With
End Sub
Thanks in advance,
~ Doug