Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Open Outlook Item
Message
From
03/04/2006 12:57:57
 
 
To
01/04/2006 09:17:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Miscellaneous
Thread ID:
01109515
Message ID:
01109993
Views:
16
Thanks Marcia,
The .GetFirst you suggested don't seem to be returning the correct object.
In fact it seems to not be working at all. I have an old draft email that
always seems to be returned as .GetFirst no matter what.
Even in debug mode I would think that successive calls would highlight
different emails in my Drafts folder. I am using Redemption / oSafeItem
My code creates the Email in the Drafts folder fine, .GetFirst .GetNext
.GetWhatever does not bring in my oSafeItem with my attachment so I can
Display it so a user can resolve the 'To'. I've tried
oMsg = oSafeItem.item
oMsg.Display but this don't work either.

My original code:
oDrafts.Items.GetFirst
oDrafts.Display
would display my drafts folder with the correct email highlighted - I would
then have to hit or doubleclick to open it. ANYWAY MY CODE IS BELOW.....thanks.
oOutlook 	= Createobject("Outlook.application")
oSafeItem	= Createobject("Redemption.SafeMailItem")
oNameSpace 	= oOutlook.GetNameSpace( "MAPI" )
oDrafts		= oNameSpace.GetDefaultFolder(16)
oInbox		= oNameSpace.GetDefaultFolder(6)
oMailS		= oOutlook.CreateItem( 0 )
oSafeItem.Item = oMailS

oSafeItem.subject 	= xsubject
oSafeItem.Body 		= xbody
xrecipient = ""
oSafeItem.Recipients.Add(xrecipient)
*********oSafeItem.SentOnBehalfOfName = "Kellyl@apexmedia.com"


fname = xpdf + ".pdf"
oSafeItem.Attachments.Add( (fname) )

oSafeItem.Save
oUtils = Createobject("redemption.MAPIUtils")

IF !EMPTY(thisform.pageframe1.page1.cbxPreviewPDFs.Value)
	rptpath = xpdf +".pdf"		&& ALWAYS PREVIEW
	!/N "C:\Program Files\Adobe\Acrobat 7.0\Reader\acroRd32.exe" &rptpath
ENDIF

IF EMPTY(thisform.pageframe1.page1.cbxNotify.Value)	&& display on each?
ELSE	
	
	If !oSafeItem.Recipients.ResolveAll()	&& yes
		IF Messagebox(ALLTRIM(msgbox_na) +CHR(13)+ ;
						"The EMAIL needs a        
                                                 Recipient." +CHR(13)+;
						"YES  =  Let me see it Now"                                         +CHR(13)+;
						"NO   =  I'll Resolve it  Later",36, " Attention!") =6 &&YES
SET STEP ON
*			oDrafts.Display
*		oMsg =oSafeItem.Items.GetFirst()

			oMsg =oDrafts.Items.GetFirst
			=oMsg.Display
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform