Solved

Using stationary with the DoCmd.SendObject action

Posted on 2004-04-02
10
468 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
 

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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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.

867 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now