Solved

Using stationary with the DoCmd.SendObject action

Posted on 2004-04-02
10
465 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
Comment Utility
dont know if that is possible, have you considered outlook automation?

0
 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
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
Comment Utility
0
 

Author Comment

by:employment-law
Comment Utility
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
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
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
Comment Utility
any luck with this?
0
 
LVL 50

Expert Comment

by:Steve Bink
Comment Utility
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
Comment Utility
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
Comment Utility
PAQed, with points refunded (130)

Computer101
E-E Admin
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

771 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

11 Experts available now in Live!

Get 1:1 Help Now