A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Cant send user edited message cleanly



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 16th 06, 02:10 AM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 4
Default 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

Ads
  #2  
Old January 16th 06, 11:18 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default 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


  #3  
Old January 16th 06, 11:58 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 4
Default 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



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Public Folder contacts form: 1 field can't be edited [email protected] Outlook - General Queries 1 March 7th 06 05:23 PM
user getting System Administrator Undeliverable message Patricia J Archibald Outlook - Calandaring 0 February 27th 06 08:57 PM
User wants to base a rule for outgoing message on Flagged properti Booger_Boy Outlook - Using Forms 0 February 8th 06 06:49 PM
how to find an edited but unsaved attachment jgpenner Outlook Express 5 February 8th 06 02:32 PM
I want to send a new message to a user when a specific email arriv Michael Bauer Outlook and VBA 1 January 9th 06 04:02 PM


All times are GMT +1. The time now is 08:24 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-2025 Outlook Banter.
The comments are property of their posters.