Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP-Outlook
Message
De
27/05/1999 03:51:54
Vladimir Zhuravlev
Institute of the Physics of Earth,Russia
Moscow Region, Russie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00222848
Message ID:
00223319
Vues:
40
>On the same lines, I have this code someone posted here previously that I made a change or 2 to:
>LOCAL loForm
>loForm = createobject( 'form')
>WITH OFORM
> .addobject("Session1", "olecontrol", "MSMAPI.mapiSession")
> .addobject("Message1", "olecontrol", "MSMAPI.mapiMessages")
> .Session1.signon()
> WITH .MESSAGE1
> .sessionid = OFORM.Session1.sessionid
> .compose()
> .msgsubject = "Put the Subject here"
> .msgnotetext = "Test goes here, you can send anything you want"
> .AddressResolveUI = .T.
> .RecipAddress = "DOUGLAS.OSBORNE@SASIPOS.COM"
> .AttachmentName="mistakes.txt"
> .AttachmentPathName="c:\dbm\"
> *
> *-OLE IDispatch exception code 0 from MAPIMessages:
> *-Upspecified Failure has occurred..
> *
> .send()
> ENDWITH
> .Session1.signoff()
>ENDWITH
>
>I get the error as noted above the send code - what parameter setting am I missing? How do you send more than 1 attachment?
> Doug

Thanks for unswer, what I did was not MAPI, here I had success before, it was outlook
Here is the code
Here is the code, I used.
1 Make message
#INCLUDE outlook.h

oOutLookObject = CREATEOBJECT("Outlook.Application")

olNameSpace = oOutlookObject.GetNameSpace("MAPI")

oEmailItem = oOutLookObject.CreateItem(olMailItem)
WITH oEmailItem
.Body = "Hello from Russian VFP developer"
.To = "boba@synapse.ru"
.Subject = "Problem"
.ReadReceiptRequested = True
.Importance = olImportanceHigh
.Display
.Save

.send
ENDWITH
2 Look out box

#INCLUDE outlook.h

oOutLookObject = CREATEOBJECT("Outlook.Application")
olNameSpace = oOutlookObject.GetNameSpace("MAPI")
oML = olNameSpace.GetDefaultFolder(olFolderOutBox).Items
?oML.Count
for i=1 to oML.Count step 1
?oML.Item(i).body

Give possitive result, print my mail body
but there is nothing in outlook itself , if to call it manual

?oML.Item(i).forward()
Gives error at all computers,
endfor

So what is the puzzle, the message can be created, saved somewhere in
outbox by coding, but not visible at outlook itself.
It is not possible to use forward in the code, but manual forward work in
outlook.
I took outlook model looking it in exlel object browerser, I was not able to get outlook basic help manul, what was propably is the reason of my trouble,
here is not problem with programming, the problem with getting normal outlook documentation
In 1997 I already had success sending mail from VFP with
mabri active x mail control and calling mapi , so that is why
is imberision to me to fail now.
Thanks one again, sorry for mistakes
Best wishes, Vladimir Zhuravlev
MVP-2006-2011, PHD in Math and Physics ,
host of www.foxclub.ru,
VFP lector at Interface and Microinform companies
Head science researcher of VNIIA Rosatom.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform