Solved

Using stationary with the DoCmd.SendObject action

Posted on 2004-04-02
10
473 Views
Last Modified: 2012-05-04
Have automated sending an e-mail using the DoCmd.SendObject method, however I need the resulting e-mail to use Stationary and a signature, but cant get this on the mail. Any help would be very much appreciated!
0
Comment
Question by:employment-law
10 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 10739702
dont know if that is possible, have you considered outlook automation?

0
 
LVL 65

Expert Comment

by:rockiroads
ID: 10739720
there is some sample code here, wonder if you can expand on this to add your stationary/signature

http://www.experts-exchange.com/Databases/MS_Access/Q_20916531.html
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 10739818
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

Author Comment

by:employment-law
ID: 10740095
Hmm, not sure how to include any kind of formatting in the example, have defaulted Outlook Express to use the stationary and Signature, but when passing the info from my form the email created is standard with no formatting.
0
 

Author Comment

by:employment-law
ID: 10824098
The second link seems to be discussing my problem exactly, but I can make no sense of it! Is it just me? The command I am using is:

    DoCmd.SendObject acSendNoObject, , acFormatHTML, "" & [EMail], , , "ELAS Reply", "" & [Notes], False, "C:\Documents and Settings\andy\Local Settings\Temporary Internet Files\Content.IE5\NSUGBRVL\Stationary.html"

All references to this command I can find do not use the last argument  (templatefile). Im tearing my hair out! please save me from going bald!
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 11029673
Howdo, regarding this

Ive tried all sorts, even using existing stationary (e.g.  "C:\Program Files\Microsoft Office\Stationery\1033\Jungle.htm")
and still no luck, what I found was, the email is always set to Plain Text , even though acFormatHTML was specified

change your False to True to leave the new mail msg window open, and see for yourself

 DoCmd.SendObject acSendNoObject, , acFormatHTML, "" & [EMail], , , "ELAS Reply", "" & [Notes], True, "C:\Documents and Settings\andy\Local Settings\Temporary Internet Files\Content.IE5\NSUGBRVL\Stationary.html"


I had a look at Outlook Automation, but the only way I could see of adding stationary in there was to create the html syntax string and set the property HTMLBody





0
 
LVL 65

Expert Comment

by:rockiroads
ID: 11567014
any luck with this?
0
 
LVL 50

Expert Comment

by:Steve Bink
ID: 11954906
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:

Accept - rockiroads

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

RoutineT
EE Cleanup Volunteer

0
 

Author Comment

by:employment-law
ID: 11961358
Sorry guys, kept meaning to reply n then getting distracted! Could not get stationary working in Outlook Express, however the following works with Outlook:


    ' Create the Outlook session.
    Set objOutlook = CreateObject("Outlook.Application")
   
    ' Create the message.

    Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
   
    With objOutlookMsg
         ' Add the To recipient(s) to the message.
         Set objOutlookRecip = .Recipients.Add("" & [EMail])
         objOutlookRecip.Type = olTo
       
        ' Set the Subject, Body, and Importance of the message.
        'sets an HTML background to the message (STATIONERY)
                   
        .HTMLBody = "<html><head></head><body background=" & Chr(34) & "C:\Program Files\Common Files\Microsoft Shared\Stationery\Stationary.gif" & Chr(34) _
            & " bgcolor=" & Chr(34) & "#C9B49A" & Chr(34) & ">" & [Notes] & "</body></html>"
        .Subject = "Elas Response"
        .Display
        ' Resolve each Recipient's name.
        For Each objOutlookRecip In .Recipients
            objOutlookRecip.Resolve
        Next
     
    End With
    Set objOutlook = Nothing

I attached the code to a button after the user enters the notes, tey populate the subjects of an e-mail, which can then be sent. Still requires user intervention to click the Send button, and if Outlook not open when it is run does some odd things, but works to a fashion....

Thanx for the help

Andy
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 11985520
PAQed, with points refunded (130)

Computer101
E-E Admin
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question