![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
I have Outlook 2003. Basically I have an email in my inbox and when I run
this macro, I want the email to be moved to the folder "Problem Report\Laptop" and then open this folder. My code works fine, but it's the last line (e.g. objFolder.Display) that I don't like. I want to open the folder, but not launch a new window. If I manually open different folders, new windows don't open so I'm hoping to do the same with code. I'm limited to what I know with VBA so this was the only code I could at least get working. Here is my code: ' Opens folder Problem Report\Laptop Dim objOlApp As Outlook.Application Dim objRecipient As Outlook.Recipient Set objOlApp = CreateObject("Outlook.Application") Set objNS = objOlApp.GetNamespace("MAPI") Set objRecipient = objNS.CreateRecipient("Problem Report") Set objFolder = GetFolder("Mailbox - Problem Report\Laptop") objFolder.Display 'Will launch new window Any assistance would be greatly appreciated. Thanks! |
#2
|
|||
|
|||
![]()
Use this statement instead:
Set objOLApp.ActiveExplorer.CurrentFolder = objFolder -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "LDMueller" wrote in message ... I have Outlook 2003. Basically I have an email in my inbox and when I run this macro, I want the email to be moved to the folder "Problem Report\Laptop" and then open this folder. My code works fine, but it's the last line (e.g. objFolder.Display) that I don't like. I want to open the folder, but not launch a new window. If I manually open different folders, new windows don't open so I'm hoping to do the same with code. I'm limited to what I know with VBA so this was the only code I could at least get working. Here is my code: ' Opens folder Problem Report\Laptop Dim objOlApp As Outlook.Application Dim objRecipient As Outlook.Recipient Set objOlApp = CreateObject("Outlook.Application") Set objNS = objOlApp.GetNamespace("MAPI") Set objRecipient = objNS.CreateRecipient("Problem Report") Set objFolder = GetFolder("Mailbox - Problem Report\Laptop") objFolder.Display 'Will launch new window Any assistance would be greatly appreciated. Thanks! |
#3
|
|||
|
|||
![]()
Perfect! Thank you so much Sue.
LDMueller "Sue Mosher [MVP-Outlook]" wrote: Use this statement instead: Set objOLApp.ActiveExplorer.CurrentFolder = objFolder -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "LDMueller" wrote in message ... I have Outlook 2003. Basically I have an email in my inbox and when I run this macro, I want the email to be moved to the folder "Problem Report\Laptop" and then open this folder. My code works fine, but it's the last line (e.g. objFolder.Display) that I don't like. I want to open the folder, but not launch a new window. If I manually open different folders, new windows don't open so I'm hoping to do the same with code. I'm limited to what I know with VBA so this was the only code I could at least get working. Here is my code: ' Opens folder Problem Report\Laptop Dim objOlApp As Outlook.Application Dim objRecipient As Outlook.Recipient Set objOlApp = CreateObject("Outlook.Application") Set objNS = objOlApp.GetNamespace("MAPI") Set objRecipient = objNS.CreateRecipient("Problem Report") Set objFolder = GetFolder("Mailbox - Problem Report\Laptop") objFolder.Display 'Will launch new window Any assistance would be greatly appreciated. Thanks! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Minimizing the Outlook Window in Code | Robert Jones | Outlook and VBA | 1 | November 25th 06 03:56 PM |
Open Links in New Window | varguda | Outlook Express | 3 | October 4th 06 01:16 PM |
New window doesn't open | mo32a | Outlook Express | 4 | September 30th 06 07:11 PM |
open a new window for a new mail | norm | Outlook Express | 1 | September 12th 06 08:17 PM |
Hyperlinks in emails open a folder window, not Internet Explorer | Jerom | Outlook Express | 3 | August 6th 06 05:20 PM |