![]() |
Cant send user edited message cleanly
All
My code generates a message that is presented to the user who selects the approprite person to sent to & reviews the mesasge before manually sending it The problem is when they hit sent it sits in the outbox so I added the following lines thanks to Dimitri which will sent the message provided the explorer window is open. Set btn = objExplorer.CommandBars.FindControl(1, 7095) btn.Execute Altho the user has not hit sent by the time these 2 lines are executed they seem to do the trick The problem is the user is left with the explorer window open after the message is sent The problem exists with ot without the use of redemption Does anyone have some code that when the users initiates the send it sends Ok Or else how can I clean up the explorer window after which is left open I am using outlook 2003 with exchange Many Thanks Tony The Code Dim objOutlook As Object Dim objOutlookMsg As Object Dim objOutlookRecip As Object Dim NS As Object Dim objInbox As Object Dim objExplorer As Object Dim objRedempMsg As Object Dim btn As Object ' Create the Outlook session. Set objOutlook = CreateObject("Outlook.Application") 'Logon to MAPI Set NS = objOutlook.GetNamespace("MAPI") NS.Logon 'this is required to get Outlook to send else it sits in the outbox after the users hits send 'need to expose the explorer window before doing a sendkey later Set objInbox = NS.GetDefaultFolder(olFolderInbox) Set objExplorer = objOutlook.Explorers.Add(objInbox, olFolderDisplayNormal) objExplorer.Display objExplorer.WindowState = olMinimized ' Create the message. Set objOutlookMsg = objOutlook.CreateItem(olMailItem) 'Create Redemption Safe Mail - library Redemption.dll Set objRedempMsg = CreateObject("Redemption.SafeMailItem") 'Point the message to Redemption objRedempMsg.Item = objOutlookMsg strrecipient = "John Brown" Dim strBody As String strBody = "Attached please find a Memo which initiates a Non Conformance." With objRedempMsg Set objOutlookRecip = .Recipients.Add(strrecipient) objOutlookRecip.Type = olTo .Subject = "A New Non Conformance has been raised - OUTLOOK TEST ONLY " .Body = strBody ' Resolve each Recipient's name. For Each objOutlookRecip In .Recipients If Not objOutlookRecip.Resolve Then objRedempMsg.Display End If Next .Display End With 'Need to force the send at times outlook explorer needs to be visible Set btn = objExplorer.CommandBars.FindControl(1, 7095) btn.Execute ExitProc: 'Set objOutlookMsg = Nothing Set objOutlook = Nothing 'Set objOutlookRecip = Nothing |
Cant send user edited message cleanly
Call the Explorer.Close method when you are done with it, and set your
Explorer variable to nothing to clean up. -- Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ " wrote: All My code generates a message that is presented to the user who selects the approprite person to sent to & reviews the mesasge before manually sending it The problem is when they hit sent it sits in the outbox so I added the following lines thanks to Dimitri which will sent the message provided the explorer window is open. Set btn = objExplorer.CommandBars.FindControl(1, 7095) btn.Execute Altho the user has not hit sent by the time these 2 lines are executed they seem to do the trick The problem is the user is left with the explorer window open after the message is sent The problem exists with ot without the use of redemption Does anyone have some code that when the users initiates the send it sends Ok Or else how can I clean up the explorer window after which is left open I am using outlook 2003 with exchange Many Thanks Tony The Code Dim objOutlook As Object Dim objOutlookMsg As Object Dim objOutlookRecip As Object Dim NS As Object Dim objInbox As Object Dim objExplorer As Object Dim objRedempMsg As Object Dim btn As Object ' Create the Outlook session. Set objOutlook = CreateObject("Outlook.Application") 'Logon to MAPI Set NS = objOutlook.GetNamespace("MAPI") NS.Logon 'this is required to get Outlook to send else it sits in the outbox after the users hits send 'need to expose the explorer window before doing a sendkey later Set objInbox = NS.GetDefaultFolder(olFolderInbox) Set objExplorer = objOutlook.Explorers.Add(objInbox, olFolderDisplayNormal) objExplorer.Display objExplorer.WindowState = olMinimized ' Create the message. Set objOutlookMsg = objOutlook.CreateItem(olMailItem) 'Create Redemption Safe Mail - library Redemption.dll Set objRedempMsg = CreateObject("Redemption.SafeMailItem") 'Point the message to Redemption objRedempMsg.Item = objOutlookMsg strrecipient = "John Brown" Dim strBody As String strBody = "Attached please find a Memo which initiates a Non Conformance." With objRedempMsg Set objOutlookRecip = .Recipients.Add(strrecipient) objOutlookRecip.Type = olTo .Subject = "A New Non Conformance has been raised - OUTLOOK TEST ONLY " .Body = strBody ' Resolve each Recipient's name. For Each objOutlookRecip In .Recipients If Not objOutlookRecip.Resolve Then objRedempMsg.Display End If Next .Display End With 'Need to force the send at times outlook explorer needs to be visible Set btn = objExplorer.CommandBars.FindControl(1, 7095) btn.Execute ExitProc: 'Set objOutlookMsg = Nothing Set objOutlook = Nothing 'Set objOutlookRecip = Nothing |
Cant send user edited message cleanly
Thanks Eric
That does the trick Tony Eric Legault [MVP - Outlook] wrote: Call the Explorer.Close method when you are done with it, and set your Explorer variable to nothing to clean up. -- Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ " wrote: All My code generates a message that is presented to the user who selects the approprite person to sent to & reviews the mesasge before manually sending it The problem is when they hit sent it sits in the outbox so I added the following lines thanks to Dimitri which will sent the message provided the explorer window is open. Set btn = objExplorer.CommandBars.FindControl(1, 7095) btn.Execute Altho the user has not hit sent by the time these 2 lines are executed they seem to do the trick The problem is the user is left with the explorer window open after the message is sent The problem exists with ot without the use of redemption Does anyone have some code that when the users initiates the send it sends Ok Or else how can I clean up the explorer window after which is left open I am using outlook 2003 with exchange Many Thanks Tony The Code Dim objOutlook As Object Dim objOutlookMsg As Object Dim objOutlookRecip As Object Dim NS As Object Dim objInbox As Object Dim objExplorer As Object Dim objRedempMsg As Object Dim btn As Object ' Create the Outlook session. Set objOutlook = CreateObject("Outlook.Application") 'Logon to MAPI Set NS = objOutlook.GetNamespace("MAPI") NS.Logon 'this is required to get Outlook to send else it sits in the outbox after the users hits send 'need to expose the explorer window before doing a sendkey later Set objInbox = NS.GetDefaultFolder(olFolderInbox) Set objExplorer = objOutlook.Explorers.Add(objInbox, olFolderDisplayNormal) objExplorer.Display objExplorer.WindowState = olMinimized ' Create the message. Set objOutlookMsg = objOutlook.CreateItem(olMailItem) 'Create Redemption Safe Mail - library Redemption.dll Set objRedempMsg = CreateObject("Redemption.SafeMailItem") 'Point the message to Redemption objRedempMsg.Item = objOutlookMsg strrecipient = "John Brown" Dim strBody As String strBody = "Attached please find a Memo which initiates a Non Conformance." With objRedempMsg Set objOutlookRecip = .Recipients.Add(strrecipient) objOutlookRecip.Type = olTo .Subject = "A New Non Conformance has been raised - OUTLOOK TEST ONLY " .Body = strBody ' Resolve each Recipient's name. For Each objOutlookRecip In .Recipients If Not objOutlookRecip.Resolve Then objRedempMsg.Display End If Next .Display End With 'Need to force the send at times outlook explorer needs to be visible Set btn = objExplorer.CommandBars.FindControl(1, 7095) btn.Execute ExitProc: 'Set objOutlookMsg = Nothing Set objOutlook = Nothing 'Set objOutlookRecip = Nothing |
All times are GMT +1. The time now is 08:17 PM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com