Using CDO to create a draft-only in Gmail

Isaac

Lifelong Learner
Local time
Today, 13:35
Joined
Mar 14, 2017
Messages
11,002
Has anyone ever used something like CDO to create a draft (not send) message in Gmail? I didn't think it was possible but figured I'd ask?

Or is there a relatively easy to use tool for this of any kind? CDO itself has given me widely varying mileage depending on the PC it runs on, so I'm not getting my hopes up here...
 
Hi. You're best bet is probably to use Google API, if they have one (they should) for GMail.
 
The only thing I can suggest is you have a look at my website here:-


where I blogged about sending emails with CDO, I don't remember anything about creating a draught email though.

There are links to several resources, and also to Colin's (Isladog) website where he has also investigated CDO...

The download is available for free, contact me for details.
 
The link UG mentioned is to my CDO EMail Tester app.
It will work with HTML or plain emails including GMail.

As for creating a draft email but not sending it, CDO is of course designed to avoid the need to use or even open Outlook.
Therefore the question is where would the draft email be saved?

However, I did have clients who wanted to use CDO but send he email only after it was first viewed in Outlook.
Therefore, if you are happy to save the draft in Outlook, I can also provide that code
 
As for creating a draft email but not sending it, CDO is of course designed to avoid the need to use or even open Outlook.
Therefore the question is where would the draft email be saved?

However, I did have clients who wanted to use CDO but send he email only after it was first viewed in Outlook.
Therefore, if you are happy to save the draft in Outlook, I can also provide that code
Unfortunately, my requirement includes not to use Outlook. Yes, that's what I was afraid of...CDO can't really do anything to reach into GMAIL and save a draft. I might need to look for something from Google on this one. If they even have something that vba can interact with.
 
You might find this book by Bruce McPherson useful:-

Going Gas: from VBA to Apps Script
By Bruce Mcpherson
Publisher: O'Reilly Media
Release Date: February 2016
Pages: 456

One reader comment:-
As mentioned in the description, the book is mostly suited for developers who are moving from Microsoft office to GAS. One thing I feel is that the content is little old. Its 2019 and the Author should take some care to update the book.

To put the comment in context, I understand there have been several changes to Google Apps Script over the last 4 years, since the book was written. Some of the content might be out of date. However I would say that Bruce McPherson is easy to contact, and if you have any particular issues I'm sure you will find him most helpful.

And here's the best bit, you can sign up to O'Reilly for free for 10 days and have a good look at the book and judge for yourself.

I would also recommend the O'Reilly website, and in particular, there are several video lessons on using Google apps script, this one by Bruce McPherson:- Google Apps Script for Beginners bear in mind that it is 2016, so it may refer to some obsolete coding practices in Google apps script.

Link to:- Going Gas: from VBA to Apps Script
 
Yeah I tried to dabble a little bit in google apps script when I was using google sheets with AppSheet to build apps but never got beyond the beginner's tutorial. In this case what I am looking for is a vba solution, though - something i can code in vba. I may have been naive in thinking google would provide a DLL or something like that..
 

Users who are viewing this thread

Back
Top Bottom