Automating TO field population

G

geekykamikaze

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top