Change 'from' field 
Author Message
 Change 'from' field

Is there a way to change the 'from' field for an Outlook Mail object in VBA?

Thanks in advance

-Ann



Mon, 08 Mar 2004 06:12:13 GMT  
 Change 'from' field
Hi,
try the following code:

Dim objSession As MAPI.Session
Dim objMessage As MAPI.Message
Dim objFolder As MAPI.folder
Dim objAdrEntry As MAPI.AddressEntry

' start CDO session
Set objSession = CreateObject("MAPI.Session")
objSession.Logon , , False, False

' Get the current folder
Set objFolder = objSession.Inbox

' Add a new message
Set objMessage = objFolder.Messages.Add

' Set the message class and subject
objMessage.Type = "IPM.Note"
objMessage.Subject = "New post to this folder"

' Set message originator
Dim rcpts As MAPI.Recipients
Dim rcpt As MAPI.Recipient
Dim objto As MAPI.AddressEntry

Set rcpts = objMessage.Recipients

Call rcpt.AddressEntry.Update

Call rcpt.AddressEntry.Update

Call rcpt.AddressEntry.Update

Dim SenderAdr As MAPI.Recipient

Call SenderAdr.AddressEntry.Update
objMessage.Sender = SenderAdr.AddressEntry
SenderAdr.Delete

' Update and post message
objMessage.TimeReceived = Now
objMessage.TimeSent = Now
objMessage.Sent = True
objMessage.Submitted = False
objMessage.Unread = True
objMessage.Update


Quote:
> Is there a way to change the 'from' field for an Outlook Mail object in
VBA?

> Thanks in advance

> -Ann



Mon, 08 Mar 2004 19:12:26 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Changing 'field size' in existing table

2. Changing a field's contents using VBA

3. Change a field's data type through code

4. Help Changing Table's Field Type and Format using DOA

5. Changing a field's default setting.

6. changing field prop's or copying data to another table

7. Changing a field's contents in VBA

8. Change field's Size property via code

9. change furmula field's value at run time

10. CR7 - Changing a Field's Font Based on a Formula

11. Changing a field's back color ?

12. How to change a field's size?

 

 
Powered by phpBB® Forum Software