Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Anil Sharma
  Where is Anil Sharma?
 ludhiana
 India
 Anil Sharma
 To: Venu8 N
  Where is Venu8 N?
 Visakhapatnam
 India
 Venu8 N
 Tags
Subject: RE: http://weblogs.foxite.com/simonarnold/a
Thread ID: 200275 Message ID: 200276 # Views: 36 # Ratings: 1
Version: Visual FoxPro 9 Category: Microsoft Office Automation
Date: Monday, October 27, 2008 9:32:57 AM         
   


> Refer to the Simon Arnold's article http://weblogs.foxite.com/simonarnold/articles/320.aspx.
>
> I tried running the code of the first block very basic sendin of an email. But VFP is rejecting saying a compile error "command contains unrecognized phrase or key word" at the point in the code where it is shown in bold letters.
>
> could someone please help me in resolving this?
>
> Regards,
>
> Srikant
>
>
> The code which I am running is also pasted here for your immediate reference.
>
> LOCAL loOutlook AS Outlook.Application
>
> LOCAL loNameSpace AS Outlook.NameSpace
>
> LOCAL loMailItem AS Outlook.MailItem
>
> LOCAL llShowItem AS Boolean
>
>
>
> #DEFINE olMailItem 0
>
>
>
> loOutlook = CREATEOBJECT('Outlook.Application')
>
> loNameSpace = loOutlook.GetNamespace("MAPI")
>
> loNameSpace.Logon
>
> loMailItem = loOutlook.CreateItem( olMailItem ) && This creates the MailItem Object
>
> llShowItem = .T.
>
>
>
> WITH loMailItem
>
> .Subject = “Test Email with VFP Automation”
>
> .Recipients.Add(“fred.bloggs@bloggsville.com”)
>
> .Body = “This is the Main Text of the email“
>
>
>
> IF llShowItem
>
> .Display && Shows the New Message Dialog with all details from
>
> && above filled in.
>
> ELSE
>
> .Send && Calling this will cause a Security Dialog
>
> ENDIF
>
>
>
> ENDWITH



Check the quote sign that is not chr(34) or " its chr(148) or ”.
so just change all the quote sign in ur prg :)

Anil
My Blog



COMPLETE THREAD
http://weblogs.foxite.com/simonarnold/a Posted by Venu8 N @ 10/27/2008 9:29:18 AM
RE: http://weblogs.foxite.com/simonarnold/a Posted by Anil Sharma @ 10/27/2008 9:32:57 AM
RE: http://weblogs.foxite.com/simonarnold/a Posted by Venu8 N @ 10/27/2008 10:27:38 AM
RE: http://weblogs.foxite.com/simonarnold/a Posted by Venu8 N @ 10/27/2008 10:34:27 AM
RE: http://weblogs.foxite.com/simonarnold/a Posted by Anil Sharma @ 10/27/2008 10:41:25 AM
RE: http://weblogs.foxite.com/simonarnold/a Posted by Venu8 N @ 10/27/2008 10:45:52 AM
RE: http://weblogs.foxite.com/simonarnold/a Posted by Venu8 N @ 10/27/2008 10:53:53 AM
RE: http://weblogs.foxite.com/simonarnold/a Posted by Anil Sharma @ 10/27/2008 11:35:50 AM
RE: http://weblogs.foxite.com/simonarnold/a Posted by M. Akram Bhatti @ 10/27/2008 9:36:27 AM