Solved

VB create outlook mail WITH default signature

Posted on 2004-08-17
4
1,616 Views
Last Modified: 2012-06-27
Hi,

I am using a straightforward vbscript to create and display an e-mail with To, Subject, Attachment etc fields already completed. This works absolutely fine. The only problem I have is that I would like to also include the person who created the e-mail's default outlook signature if they have one. I have no idea how to do this and I have not been able to find a solution anywhere on the net.

The existing code I am using is below, I am using outlook 2000 and 2003 and this works on both.

Dim objAppOutLook
Dim objOutlookMsg
Dim objOutlookNameSpace

Set objAppOutLook = CreateObject("Outlook.Application")
Set objOutlookNameSpace = objAppOutLook.GetNamespace("MAPI")
objAppOutLook.Session.Logon
Set objOutlookMsg = objAppOutLook.CreateItem(0)
 
objOutlookMsg.To = "test@test.com"
objOutlookMsg.cc = "test@test.com"
objOutlookMsg.Subject = "Hello"
objOutlookMsg.Body = "Does it work?"
'objOutlookMsg.Attachments.Add attachment, 1, , attachment
objOutlookMsg.Importance = 2
objOutlookMsg.Display

objAppOutLook.Session.Logoff
set objAppOutLook = Nothing
set objOutlookNameSpace = Nothing
set objOutlookMsg = Nothing

cheers

Richard
0
Comment
Question by:richierichie
[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
4 Comments
 
LVL 3

Accepted Solution

by:
realrael earned 250 total points
ID: 11827261

there might not be a way to do it because the outlook object did not expose that function. you could work around it though. - rael

http://www.outlookcode.com/codedetail.aspx?id=162
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

739 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