Frank - I think what you suggested would Send it. He simply wants it on the screen to view. I think its possible that the window is Hidden some how. Must be a way to place it on top.

I've done this kinda stuff in the past - using the same book at examples in it. But, I'm confounded at the "Explorer" references in your code Mike!

FYI - I believe there is a ".Visible" option that you must use somewhere in your code - and THAT may make the email visible to use for viewing before sending! Just a WAG here...

Again - its been YEARS since I did the Office Auto. stuff!

-K-

On 9/3/2019 2:41 PM, Frank Cazabon wrote:
Off the top of my head (and is been a long time since I did this) but try 
passing true to the send (.t.) I think that might display the email ready to be 
sent.

On 3 September 2019 16:53:17 GMT-04:00, "MB Software Solutions, LLC" 
<mbsoftwaresoluti...@mbsoftwaresolutions.com> wrote:
I have a need to use MAPI (yes, I know Ted et al: MAPI bad, SMTP
good...but this customer wants to see a system generated email in
Outlook, review it including file attachment, and then press Send
manually).  I thought I was going to have to use the Redemption tool to

get around the security issues with Outlook but I'm stunned that this
simple code worked on my laptop which has Outlook 2016 on it:

LOCAL oOutlook as Outlook.Application, oNamespace as Outlook.NameSpace,

oMailItem as Outlook.MailItem
oOutlook = CREATEOBJECT("Outlook.Application")
#DEFINE olFolderDisplayNormal 0
#DEFINE olMailItem 0
oNameSpace = oOutlook.GetNameSpace("MAPI")
oExplorer =
oOutlook.Explorers.Add(oNameSpace.Folders[1],olFolderDisplayNormal)
oMailItem = oOutlook.CreateItem(olMailItem)
WITH oMailItem
     .Subject = 'Testing email send'
     .Body = "Thank you for your participation in the test at " +
TTOC(DATETIME())
     .Recipients.Add("mbabc...@mbsoftwaresolutions.com")
     .Attachments.Add("C:\crap\MyFile.pdf")
     .Save()
     *.Send() && commented out for now as I don't want to
auto-send...user wants to review and manually Send
ENDWITH

oExplorer.Activate()


This is basically using the code from the Microsoft Office Automation
with Visual FoxPro book from HWP.  (Thanks for the cue, Ted!).  Now the

comment and question:

1. I'm amazed that Outlook 2016 let me do this without any
    warning/blocking.  I was thinking I'd have to use the Outlook
    Redemption add-in tool (http://www.dimastr.com/redemption/)
2. The sample code above saves it to the Drafts folder but when I open
    OL via the last line (oExplorer.Activate()), I was hoping to have
    the email front and center so the user could just press the Send
    button after reviewing it manually on screen.  Any ideas how to
    achieve that?

tia,
--Mike




---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance:
https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list:
https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message:
https://leafe.com/archives/byMID/f7d9c573-16a6-b737-9aaa-f288fa112...@mbsoftwaresolutions.com
** All postings, unless explicitly stated otherwise, are the opinions
of the author, and do not constitute legal or medical advice. This
statement is added to the messages for those lawyers who are too stupid
to see the obvious.
Report [OT] Abuse:
http://leafe.com/reportAbuse/f7d9c573-16a6-b737-9aaa-f288fa112...@mbsoftwaresolutions.com

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/c388111b-0fbc-517d-5307-5cdf7c42f...@optonline.net
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to