A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Copy First Recipient to a Field



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 2nd 06, 07:27 PM posted to microsoft.public.outlook.program_forms
adubb
external usenet poster
 
Posts: 13
Default Copy First Recipient to a Field

I was wondering if anyone knew how to copy the first email adressee to
another specified field. For example in my "To:" Field there is a list of
email addresses the email should go to. And what i want to do is copy the
first email address to another custom textbox. Below is my code but I can't
seem to get it to work.

Function Item_Send()
Dim i
Dim objPage
Dim objControlSentTo
i = InStr(Item.To, ";")
If i = 0 Then
i = InStr(Item.To, ",")
If i 0 Then
Set objPage = Item.GetInspector.ModifiedFormPages("Terminated Employee
Check List")
Set objControlSentTo = Item.GetInspector.ModifiedFormPages("Terminated
Employee Check List") _
..Controls("TextBox11")

While i 0
objControlSentTo = Mid(Item.To, i - 1)
i = 0
Wend
End If
End Function
Ads
  #2  
Old May 16th 06, 04:56 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Copy First Recipient to a Field

objControlSentTo.Value = Mid(Item.To, i - 1)

But this is a futile operation, because any values in unbound text boxes are not persisted when the item is sent. You should be setting an Outlook property instead. See http://www.outlookcode.com/d/propsyntax.htm
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"adubb" wrote in message ...
I was wondering if anyone knew how to copy the first email adressee to
another specified field. For example in my "To:" Field there is a list of
email addresses the email should go to. And what i want to do is copy the
first email address to another custom textbox. Below is my code but I can't
seem to get it to work.

Function Item_Send()
Dim i
Dim objPage
Dim objControlSentTo
i = InStr(Item.To, ";")
If i = 0 Then
i = InStr(Item.To, ",")
If i 0 Then
Set objPage = Item.GetInspector.ModifiedFormPages("Terminated Employee
Check List")
Set objControlSentTo = Item.GetInspector.ModifiedFormPages("Terminated
Employee Check List") _
.Controls("TextBox11")

While i 0
objControlSentTo = Mid(Item.To, i - 1)
i = 0
Wend
End If
End Function

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Maintain form when recipient forwards to another recipient Holly Utzinger Outlook - Using Forms 3 May 5th 06 12:40 AM
Copy and paste recipients list into To field of new email message displays as ; [email protected] Outlook - General Queries 0 March 9th 06 05:19 PM
How do I copy data from one field to another? reiner Outlook - Using Contacts 3 February 19th 06 08:56 PM
Populate Company field from Contact field in custom task form Sue Mosher [MVP-Outlook] Outlook - Using Forms 0 January 20th 06 08:37 PM
Copy 1 Text Field into another on Form, DateAdd and macros Michael Anderson Outlook and VBA 9 January 18th 06 11:37 PM


All times are GMT +1. The time now is 09:02 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.