Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / May 2004

Tip: Looking for answers? Try searching our database.

To field passed to HTML form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ketta - 21 May 2004 16:36 GMT
I know this is probably a very basic Outlook programming function but I am
really having difficulty finding information on form programming.  I know a
intermediate level of VB.NET and all but Outlook programming is completely
foreign to me.  I want to make a form (probably using the new mail message
form) and take the "To" field and send the e-mail addresses contained in
that to an HTML form.  I can make a custom button that launches the HTML
form with the POST information.  But I need that TO field data in a variable
or something so I can pass it.  I apologize if this is out of the scope of
this forum but I cannot find anything relevant online that is a free Outlook
programming resource.

Thanks
Sue Mosher [MVP-Outlook] - 21 May 2004 16:54 GMT
The addresses are in the MailItem.Recipients collection for that item.
You'll have to iterate the collection and extract the address from each
Recipient object in the collection.

Signature

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

> I know this is probably a very basic Outlook programming function but I am
> really having difficulty finding information on form programming.  I know a
[quoted text clipped - 8 lines]
>
> Thanks
Ketta - 21 May 2004 17:29 GMT
See that is what I thought... but I wrote this simple code to say how many
recipients there are, I receive a message saying "Object Required:
MailItem".  I have one person in the "To" field.  I guess I should have
pasted that first.

Public Sub OK_Click()
Dim recips
recips = MailItem.Recipients.Count
MsgBox (recips)
End Sub

> The addresses are in the MailItem.Recipients collection for that item.
> You'll have to iterate the collection and extract the address from each
[quoted text clipped - 22 lines]
> >
> > Thanks
Sue Mosher [MVP-Outlook] - 21 May 2004 17:51 GMT
MailItem is the name of an Outlook object. Your code needs to instantiate an
object *variable* that represents the particular MailItem object that you
want to work with. If you're working with the currently displayed item, and
you have already instantiated an Outlook Application object (call it objOL),
you would use this VB.Net code to get the current item:

   objInsp = objOL.ActiveInspector
   If Not objInsp Is Nothing Then
       objItem = objInsp.CurrentItem
   End If

Note that you cannot predict what type of item CurrentItem will return.
Check the item's Class property before you invoke any proeprties or methods
specific to MailItem or any other type of item.
Signature

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

> See that is what I thought... but I wrote this simple code to say how many
> recipients there are, I receive a message saying "Object Required:
[quoted text clipped - 29 lines]
> > Outlook
> > > programming resource.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.