PC Review


Reply
Thread Tools Rate Thread

Automating TO field population

 
 
geekykamikaze
Guest
Posts: n/a
 
      13th Aug 2005
Hi, all

Can anybody point me to a right direction please?

I am trying to populate "TO" field in OUTLOOK XP using VBA.So before I
get into it, I'm just playing around, as I don't have any experience
with OUTLOOK coding.

I'm trying to get it to look at the value in "To" so I can manipulate
it, however the problem is that the value is doen't show correctly.
When I type in a value in "To" field, the return value from the
following code is still null. It does show the correct value after a
few minutes. Is it because the values is stored in cache or
something????

Sub test()
Dim App As Object
Dim Insp As Object

Set App = GetObject("", "outlook.application")
Set Insp = App.activeinspector
MsgBox Insp.currentitem.to

End Sub

This macro is attached to the session(this document)

What am I doing wrong and how can I get around this?

Any suggestions/feedback is appreciated.

Thanks in advance!

 
Reply With Quote
 
 
 
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      13th Aug 2005
At that point, Outlook has not resolved To data into actual recipient(s) with email addresses. If you call Insp.CurrentItem.Recipients.ResolveAll or Insp.CurrentItem.Save before MsgBox Insp.CurrentItem.To, you'll get the expected result.

If you're new to Outlook VBA macros, these web pages should help you get started:

http://www.winnetmag.com/Articles/In...eID=21522&pg=1
http://www.outlookcode.com/d/vb.htm


--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"geekykamikaze" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> Hi, all
>
> Can anybody point me to a right direction please?
>
> I am trying to populate "TO" field in OUTLOOK XP using VBA.So before I
> get into it, I'm just playing around, as I don't have any experience
> with OUTLOOK coding.
>
> I'm trying to get it to look at the value in "To" so I can manipulate
> it, however the problem is that the value is doen't show correctly.
> When I type in a value in "To" field, the return value from the
> following code is still null. It does show the correct value after a
> few minutes. Is it because the values is stored in cache or
> something????
>
> Sub test()
> Dim App As Object
> Dim Insp As Object
>
> Set App = GetObject("", "outlook.application")
> Set Insp = App.activeinspector
> MsgBox Insp.currentitem.to
>
> End Sub
>
> This macro is attached to the session(this document)
>
> What am I doing wrong and how can I get around this?
>
> Any suggestions/feedback is appreciated.
>
> Thanks in advance!
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automating field population on a form =?Utf-8?B?QXNuZWxs?= Microsoft Access 1 7th Nov 2007 08:15 PM
Field Population =?Utf-8?B?U2hhcm9u?= Microsoft Excel Misc 2 30th Nov 2005 11:26 PM
field population help Paul M Microsoft Access 1 18th Oct 2005 06:05 PM
Automating field population =?Utf-8?B?QmlsbEBPblNpdGVGQVNU?= Microsoft Access Database Table Design 0 11th Mar 2004 11:36 AM
Field Population groffj24 Microsoft Access 2 7th Jan 2004 12:17 PM


Features
 

Advertising
 

Newsgroups
 


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