Creating EMAIL from VBA (behind a form)

I know that it is possible to generate an email letter and send it from
VBA behind a form.  I've done that.  However, is it possible to create a
DRAFT email letter and leave it in the Drafts folder (in Microsoft
Outlook)?  If it is possible, would you share the source code with me?

Thanks.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
0
slbrick (181)
10/25/2005 9:57:07 AM
comp.databases.ms-access 42531 articles. 0 followers. Post Follow

2 Replies
329 Views

Similar Articles

[PageSpeed] 40
hello sueB,

i have an access application that reads outlook draft folder contents
and list it in a listbox-control to expose it to the users, then they
can doble-click one item and edit it that way.

well i think that what you have to do is to set an instance of a new
mail-item and instead of send it just save it to the draft folder.

does it help??.

+regards,

Susan Bricker wrote:
> I know that it is possible to generate an email letter and send it from
> VBA behind a form.  I've done that.  However, is it possible to create a
> DRAFT email letter and leave it in the Drafts folder (in Microsoft
> Outlook)?  If it is possible, would you share the source code with me?
>
> Thanks.
>
> Regards,
> SueB
> 
> *** Sent via Developersdex http://www.developersdex.com ***

0
10/25/2005 7:07:57 PM
On Tue, 25 Oct 2005 09:57:07 GMT, Susan Bricker <slbrick@verizon.net>
wrote:
>I know that it is possible to generate an email letter and send it from
>VBA behind a form.  I've done that.  However, is it possible to create a
>DRAFT email letter and leave it in the Drafts folder (in Microsoft
>Outlook)?  If it is possible, would you share the source code with me?

Public Sub SendMailWithAttachment( _
            strTo As String, _
            strAttachmentFiles As String, _
   Optional strSubject As String = "", _
   Optional strBodyText As String = "", _
   Optional bolQuitOutlook As Boolean = False, _
   Optional bolSendAsDraft As Boolean = True)

Dim OL As Object
Dim OLNS As Object 'Outlook.NameSpace
Dim MailFolder As Object 'Outlook.MAPIFolder
Dim MyMail As Object 'Outlook.MailItem
Dim varAttachments As Variant
Dim I As Integer
    
    varAttachments = Split(strAttachmentFiles, Chr$(0))
    Set OL = CreateObject("Outlook.Application")
    Set OLNS = OL.GetNamespace("MAPI")
    If bolSendAsDraft = True Then
        Set MailFolder = OLNS.GetDefaultFolder(16)
    Else
        Set MailFolder = OLNS.GetDefaultFolder("Inbox")
    End If
    Set MyMail = MailFolder.Items.Add

    With MyMail
        .To = strTo
        .Subject = strSubject
        .Body = strBodyText
        For I = 0 To UBound(varAttachments)
            If CStr(varAttachments(I)) <> "" Then  _
		.Attachments.Add CStr(varAttachments(I)), _
                1, _
                I + 1
        Next
        .Recipients.ResolveAll
        .Save
        If bolSendAsDraft = False Then
            .Send
        End If
    End With
    If bolQuitOutlook = True Then OL.Quit
    Set MyMail = Nothing
    Set MailFolder = Nothing
    Set OLNS = Nothing
    Set OL = Nothing
End Sub


-- 
     Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing

0
c.grimsby (825)
10/25/2005 10:26:24 PM
Reply:
Similar Artilces:

joining lines to form a continuous surface
Hi guys, I have got a problem while 3d plotting.After running a program in matlab i found some straight lines all of which passes through origin as expected.Now what i want is to join all these lines one after another to form a continuous surface. I think i can hope for a solution a bit elaborately as i am novice in matlab. shahriar mahmud wrote: > > > Hi guys, > > I have got a problem while 3d plotting.After running a program in > matlab i found some straight lines all of which passes through > origin > as expected.Now what i want is to join all these lines one afte...

Create/Exception then Destruct
Hi Folks, I have a question about the process of constructing and destructing objects when an exception happens in the constructor. the doc says: ----- When an exception is raised during creation of an object, Destroy is automatically called to dispose of the unfinished object. This means that Destroy must be prepared to dispose of partially constructed objects. Because a constructor sets the fields of a new object to zero or empty values before performing other actions, class-type and pointer-type fields in a partially constructed object are always nil. ----- Is that REALL...

creating objects type only known at runtime
This weekend I was playing around with some ruby and wanted to create objects whose types were only known at runtime. The method I wound up using was o = eval "#{class_name}.new" Is this a preferred method. I come from (mostly) a perl background, but also a Java background. To me this approach seems inelegant. Thanks for any input. Andy -- Andrew Libby Tangeis, LLC Innovative IT Management Solutions alibby@tangeis.com On 23/10/06, Andrew Libby <alibby@tangeis.com> wrote: > > This weekend I was playing around with some ruby and wanted > to create objects ...

Newbie in creating the fonts.
Hi. I'm a newbie of creating and editing fonts. Now I'm trying program: FontLab. It's great but All this concepts (terms, poperties) which's connected with fonts are a little incomprehensible. For example: glyphs, outlines, hints. Could You please to explain me what are these? Kind regards. -- pozdroovka. Zebik Glyphs are the individual letters. Outlines are just what it sounds like. When you draw a letter you do it just as you would with pen and paper by making the basic shape...the computer colours the inside of the shape when you use the font. Hints are what the ...

Re: Tracking what .sas file created a dataset? #3
You could add the source file to the dataset label... -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Scott D. Sent: Friday, January 12, 2007 1:33 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Tracking what .sas file created a dataset? Is there an automatic way to do know what file created a particular dataset? Say I create a dataset and store it in a library, and I later want to access this dataset but don't remember what .sas file created it. Of course I can grep *.sas, but I want to keep this information with the dataset. Any ideas here would ...

how to create virtual domain with webmin ?
Dear list, I had PLESK 7.5 on a remote server and I used to create domains with plesk . I could also access those domain from internet. Due to the lincese expiration I have discontinue with Plesk and installed webmin. So is it possible to create domain with webmin which can be accessed from internet ? thanks. ...

Access 2000 Data Entry Form goes invisible
Hello all, I have a form I designed for data entry. However, when I set the form properties to Data Entry mode, the form completely disappears for Access 2000 users. All they see is a white blank space. What could be causing this? Thanks! jhutchings@eadmotors.com wrote: > Hello all, I have a form I designed for data entry. However, when I > set the form properties to Data Entry mode, the form completely > disappears for Access 2000 users. All they see is a white blank > space. What could be causing this? Thanks! Is the recordset the form is bound to editable and do the form pro...

can not create directories like adump etc
I was trying to create a database instance using DBCA in 10G. After selecting all parameters, small window pops up and says cannot create adump directory. Do I have to create all these directory manually before I run DBCA or what. I am running dbca from oracle login account. It's pretty much giving the same error like cannot create some directories or some files for everything it's supposed to create atutomatically. I am able to create mannually all these directories but why DBCA can't create these automatically otherwise no point in creating database through DBCA. Am I ...

sequence 3 tasks
Hello &nbsp; i use a board 6023E and pc pentium4 3Ghz &nbsp; My problem is how create a delay with few microseconds between two tasks? &nbsp; I need creat three tasks. Fisrt create a finte pulse train for this i use a counter. Second create a delay for this i use again a conter to creat a pulse train in witch the delay is equal to frequency x number of pulses. Third measure pulses for this i use again a counter but in this case is a counter input. In attachment i send a picture with my program. &nbsp; I dont understand&nbsp;why my program dont work? my program take a lote ...

Q: Create a console for a GUI app
Hi! I want to create a console for a GUI application. I am using AllocConsole, which also works as expected. But then I still cannot use printf etc to write to the console, even though the documentation for AllocConsole tells me "AllocConsole initializes standard input, standard output, and standard error handles for the new console.". So what am I missing? Thanks in advance! -- jb (replace y with x if you want to reply by e-mail) "cfx" <u.t.o@wanadoo.fr> wrote in message news:bf36o3$khl$1@news-sop.inria.fr... > "Jakob Bieling&quo...

netbeans .FORM
I'm working with javaBeans in netbeans IDE4.1 When i want to create bean i use GUI Form, JApplet form or App. form. Is that file xxx.FORM also serialization of that bean?? ...

How to Create an Uninstall?
Hi, How can I get Windows to recognize an installed app so the user can uninstall it through the Control Panel? I'm not using MSIE, InstallShield, or any other off the shelf product, but a home-brewed installation program written in VC++ 6.0. Thanks. xmp333@yahoo.com wrote: > How can I get Windows to recognize an installed app so the user can > uninstall it through the Control Panel? Rather that re-inventing the wheel, I suggest taking a look at the Inno Setup program: http://www.jrsoftware.org/isinfo.htm Not only is it a fantastic installer it ...

Email
Hi all, I already posted this msg but it looks it was in a very old thread Somewhere Geoff has mentioned... >You can use HTML in the appropriate section just by simply copying it to >the cHTML ivar. So, get your editor to save its output to a text file >and read this in to your app. I am using EmailClient sample (VO 2.7a) trying to send a HTML mail which I created with OutLook Express. Would you please check what am I doing wrong: 1. I sent and received the eMail OK and after that I saved it as MyMail.eml 2. I read MyMail.txt and assign all the content ...

Dragging text to create a file?
I thought that there was a way to drag text off of a document or web page and drop it on a finder window to create a file. Something is created by the finder, but it is not the kind of file I was anticipating. Is there some way to do this?? I am hoping for something like the OS/2 WPS Drag Text SOM Class that would just extend the Finder. Thanks in advance, -- John Holt John Holt <jdholt77_evomer@remove_earthlink.net> wrote: > I thought that there was a way to drag text off of a document or web > page and drop it on a finder window to create a file. Something is >...

Create Subsystem command
Hi, is there any way to perform an "pre create subsystem" funktion or script? Means clicking on the "Create Subsystem" Button first executes a script and then Draws the Subsystem. Or is there a commandline command that creates a subsystem from the selected blocks and lines? Thanks in advance Nils ...

DAS/email notifications
Our health center used to send out notification emails but now it doesn't We dont have DAS turned on, does that need to be on in order for the emails to work? Looking into the best way to drop/recreate and get it working again...thoughts? I looked in our email logs and the last one is from 8/24, since then DB2 hasn't even attempted to send out an email it seems here's my get db2 admin cfg output: SMTP_SERVER = localhost??? Admin Server Configuration Authentication Type DAS (AUTHENTICATION) = SERVER_ENCRYPT DAS Administration Au...

Noob: Creating (create)
I'm playing with win32forth, trying to figure out how I could make the word (create) which would work inside a colon definition. So I could do: : makeit (create) foo 1 cell allot ; I'm figuring that (create) must be an immediate word - the problem is how to look ahead to get the foo. What's the answer? Mark Carter wrote: > I'm playing with win32forth, trying to figure out how I could make the > word (create) which would work inside a colon definition. So I could do: > : makeit (create) foo 1 cell allot ; > > I'm figuring that (create) must be an immedi...

Tools for creating Draw files
For a work project I may need to find a way of drawing vector art in a turnkey, embedded system. Given that I'm going to have to write all this code myself, I'm rather attracted to the idea of using Acorn drawfiles as the file format --- they're simple, reasonably compact, and dead easy to parse. However, I still need some way of creating them. Does anyone know of any tools for converting, say, SVG to !Draw, or something similar? This is most likely going to have to run on a Unix-oid command line system, so I won't be able to use anything RISC OS-based, alas. -- David Given...

MySQL
The other day, for unfathomable reasons, I lost control over tables which I create. There was no concurrent change of anything on the machine, such as an update. So I have no suspect. Does the following action log suggest any recommendation to experienced SQL programmers? 1. A table: mysql> select * from expenses; +----+------------+-------+----------+--------+-------------+-------+ | id | date | place | stuff | amount | category | flags | +----+------------+-------+----------+--------+-------------+-------+ | 38 | 2013-01-15 | ATT | Sim card | 25.00 | Visa...

Re: How to automatically create a lot of lags? #6 1556226
Yiyu, Here is way to have your LAGS. Muthia Kachirayan. data a; do price = 1 to 100; output; end; run; data b(drop = m prv); do m = 1 to 100; set a; array v[100] lag1-lag100; if m = 1 then v[m] = .; else v[m] = prv; output; prv = price; end; run; proc print data = b ; run; On 9/14/06, Yiyu <shenyiyu@gmail.com> wrote: > > Hi, I have a dataset with a lot of observations with a single variable > called Price, and I want to create , for example, 100 additional > variables representing lag1 to lag 100, what's the si...

Can I use FTP to create a CSV File?
Hi all Using Client Access/Express I can download a file straight into csv format for Excel. It works really well but we have some customers that use BOS and I want one method of creating the csv file. The file itself is just text with all of the numeric fields treated as formulae. Using FTP is it possible to download the file straight to a pc as a ..csv? We don't have the IFS. Thanks, in advance, for any help Neil Newbie_Neil wrote: > Hi all > > Using Client Access/Express I can download a file straight into csv > format for Excel. It works really well but we have som...

Problem Trying to Create Procedure
I am a newbie, so this may be a simple question. I have a sql script called p_chp_proc.sql, which creates a procedure called p_chp: CREATE OR REPLACE PROCEDURE p_chp( encoded IN VARCHAR ) IS len int := length(encoded); i int; new_password varchar(30); BEGIN -- decode password for i IN 1..len loop new_password := substr(encoded, i*2, 1); end loop; -- change password EXECUTE IMMEDIATE 'ALTER USER db_audit IDENTIFIED BY ' || new_password; END p_chp; When I try and run the script I get the error "SP2-0042: unknown command "cr_p_chp" - rest of lin...

Re: Creating multiple datasets from one dataset based on value of #10
Ian, I agree that hash is very handy. But it requires SAS9.1. :-( On 11/14/06, Ian Whitlock <iw1junk@comcast.net> wrote: > Summary: Lex's SAS search tool > #iw-value=1 > > Mike, > > I used the search engine at > > http://www.lexjansen.com/sugi/ > > with the words "hash split" to find > > [PDF] 236-30: DATA Step Hash Objects as Programming ToolsFile > Format: PDF/Adobe Acrobat > Use this functionality to "extrude" input through hash object(s) > to split it in a number of SAS files with SAS-variable-. governed > ...

Zen Cart and Google Apps Email
I'm using Zen Cart and I have Google Apps hosting my emails for my domain name. What I'm having troubles with is getting it so that I can send emails out. It seems to not give me any errors when I go to send them but the emails are not getting delivered. Has anyone worked with this before that could help me out? Thanks, Tony ...

LONG! Document Object Model - table instead of form??
The below code builds 2 tables 4 rows by 4 cols. All cells have checkboxes. When checked, the checkboxes in the first column automatically check the remainder of the check boxes in the same row. This is working fine for tables of this size. Unfortunately, my app produces lots of considerably bigger tables and the 'toggle' can take over a minute to complete!! I assume this is because for each toggle, the all form elements are searched through to see if they match. Is it possible to change this so that a toggle only has to search the elements of the table it appears in - rather than t...