Solved

Using stationary with the DoCmd.SendObject action

Posted on 2004-04-02
10
477 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

732 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