Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Suspend code

I have a procedure that sends e-mails automatically unless
the recipient is not found in which case the following
procedure is called:

Public Function enameadd()

Workbooks("file").Close savechanges:=False
Dim appoutlook As New Outlook.Application
Dim nsoutlook As NameSpace
Dim mfContacts As MAPIFolder
Dim ciContact As ContactItem

' open outlook contacts
Set nsoutlook = appoutlook.GetNamespace("Mapi")
Set mfContacts = nsoutlook.GetDefaultFolder
(olFolderContacts)
'find the contact
Set ciContact = mfContacts.Items.Find("[FullName] = "
& strEname)
If ciContact Is Nothing Then
Set ciContact = mfContacts.Items.Add
ciContact.FullName = strEname
End If
'open outlook form
ciContact.Display

Xlautoupdate 'resends email when recipient is added.

End Function

Control is passed back to the Xlautoupdate and the email
is resent. Is it possible to hold the flow of the
procedure until after the contact form has closed, at the
moment the procedure resends before the contact form is
closed.
Thanks
John
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
suspend auto increment Bill Johnson Excel Discussion (Misc queries) 6 February 8th 08 06:26 PM
Suspend calc of formula using a non-existent sheet mikeburg Excel Discussion (Misc queries) 4 December 2nd 05 12:48 AM
Screen suspend eyecalibrate[_3_] Excel Programming 2 March 3rd 04 04:44 PM
Suspend/resume running of a macro Peter[_20_] Excel Programming 3 February 9th 04 01:49 PM
Suspend viewing of macros Steve B[_2_] Excel Programming 0 July 24th 03 02:16 PM


All times are GMT +1. The time now is 07:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"