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 and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

From and to Fields VBScript



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 1st 07, 07:54 PM posted to microsoft.public.outlook.program_vba
Gil
external usenet poster
 
Posts: 12
Default From and to Fields VBScript

How can I access the from and to fields of a message in vbscript
within that message?

Thanks,
Gil

Ads
  #2  
Old May 1st 07, 08:02 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default From and to Fields VBScript

MailItem object: To, Recipients, SenderName, SenderEmailAddress properties

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Gil" wrote in message
oups.com...
How can I access the from and to fields of a message in vbscript
within that message?

Thanks,
Gil



  #3  
Old May 1st 07, 08:09 PM posted to microsoft.public.outlook.program_vba
Gil
external usenet poster
 
Posts: 12
Default From and to Fields VBScript

Is there a good reference for this type of info?

Pardon my ignorance but would this work to retrieve the sender?

Set objFormTab = Item.GetInspector.ModifiedFormPages("Message")
Set objSender = objFormTab.MailItem("SenderName")

Thanks,
Gil

On May 1, 2:02 pm, "Dmitry Streblechenko" wrote:
MailItem object: To, Recipients, SenderName, SenderEmailAddress properties


  #4  
Old May 1st 07, 08:16 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default From and to Fields VBScript

See MSDN and Outlook VBA help file. http://www.outlookcode.com is good place
to start.
The code should be

Set objSender = Item.SenderName

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Gil" wrote in message
ups.com...
Is there a good reference for this type of info?

Pardon my ignorance but would this work to retrieve the sender?

Set objFormTab = Item.GetInspector.ModifiedFormPages("Message")
Set objSender = objFormTab.MailItem("SenderName")

Thanks,
Gil

On May 1, 2:02 pm, "Dmitry Streblechenko" wrote:
MailItem object: To, Recipients, SenderName, SenderEmailAddress
properties




  #5  
Old May 1st 07, 08:28 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default From and to Fields VBScript

Actually there should be no "set" since SenderName property is a string, not
an object:

strSender = Item.SenderName

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Dmitry Streblechenko" wrote in message
...
See MSDN and Outlook VBA help file. http://www.outlookcode.com is good
place to start.
The code should be

Set objSender = Item.SenderName

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Gil" wrote in message
ups.com...
Is there a good reference for this type of info?

Pardon my ignorance but would this work to retrieve the sender?

Set objFormTab = Item.GetInspector.ModifiedFormPages("Message")
Set objSender = objFormTab.MailItem("SenderName")

Thanks,
Gil

On May 1, 2:02 pm, "Dmitry Streblechenko" wrote:
MailItem object: To, Recipients, SenderName, SenderEmailAddress
properties






  #6  
Old May 1st 07, 08:31 PM posted to microsoft.public.outlook.program_vba
Gil
external usenet poster
 
Posts: 12
Default From and to Fields VBScript

Thanks! This is in VB not VBA can I reference items like that in VB on
a message form?



  #7  
Old May 1st 07, 08:38 PM posted to microsoft.public.outlook.program_vba
Gil
external usenet poster
 
Posts: 12
Default From and to Fields VBScript

All set now! I need a good vb introduction book that is techincal, not
point and click through forms any reccomendations?

  #8  
Old May 1st 07, 08:40 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default From and to Fields VBScript

If it is VB, not VBA, your code is not running in a form; which message form
do you mean?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Gil" wrote in message
ups.com...
Thanks! This is in VB not VBA can I reference items like that in VB on
a message form?





  #9  
Old May 1st 07, 08:45 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default From and to Fields VBScript

Do you mean VB as language, not Outlook specific? I don't use VB at all, so
I can't recomment anything.
For Outlook specific books, see http://www.outlookcode.com/d/library.htm

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Gil" wrote in message
ups.com...
All set now! I need a good vb introduction book that is techincal, not
point and click through forms any reccomendations?



  #10  
Old May 1st 07, 09:21 PM posted to microsoft.public.outlook.program_vba
Gil
external usenet poster
 
Posts: 12
Default From and to Fields VBScript

On May 1, 2:45 pm, "Dmitry Streblechenko" wrote:
Do you mean VB as language, not Outlook specific? I don't use VB at all, so
I can't recomment anything.
For Outlook specific books, seehttp://www.outlookcode.com/d/library.htm

Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Gil" wrote in message

ups.com...



All set now! I need a good vb introduction book that is techincal, not
point and click through forms any reccomendations?- Hide quoted text -


- Show quoted text -


No it's outlook specific VB, got to by going Tools-Form-Design This
Form-Form-View Code

Not a pretty place to write code. I'm wondering if I should be using
the VBA portion instead. Maybe a book will tell me that!!

 




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
vbScript Not Firing Boyd Outlook - Using Forms 2 September 29th 06 11:58 PM
Outlook Contacts - Converting User-defined Item fields to Folder fields [email protected] Outlook - Using Contacts 1 September 29th 06 10:17 PM
formating multiple fields creates duplicate fields [email protected] Outlook - Using Forms 0 April 18th 06 04:59 PM
VBA or VBScript goshute Outlook and VBA 1 March 29th 06 02:01 AM


All times are GMT +1. The time now is 07:11 AM.


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.