Reply
How to show my Outlook Express Address book at ASP page
Old 12-23-2004, 08:56 PM How to show my Outlook Express Address book at ASP page
Novice Talker

Posts: 13
Trades: 0
anyone here know how can i show all my addresses in Outlook Express at a ASP Page?i have found a coding that can do it, but i really cannot make it work.

Code:
<%@ LANGUAGE="VBSCRIPT" %>
<HTML>
<HEAD><TITLE>Sent Items Display</TITLE></HEAD>
<BODY BGCOLOR=SILVER>
<%
 
'On Error Resume Next 'CONTAINER CONSTANT
	CONST CdoClassContainerRenderer = 3
	CONST CdoClassObjectRenderer = 2 'RENDERSTYLE CONSTANTS
	CONST CdoFolderContents = 1
	CONST CdoFolderHierarchy = 2 '===== Default Folder Constants ========
'These constants are passed into the Session.GetDefaultFolder()
'method to return their respective folders.	CONST CdoDefaultFolderCalendar = 0
	CONST CdoDefaultFolderInbox = 1
	CONST CdoDefaultFolderOutbox = 2
	CONST CdoDefaultFolderSentItems = 3
	CONST CdoDefaultFolderDeletedItems = 4
	CONST CdoDefaultFolderContacts = 5
	CONST CdoDefaultFolderJournal = 6
	CONST CdoDefaultFolderNotes = 7
	CONST CdoDefaultFolderTasks = 8
	CONST CdoDefaultFolderTotal = 9
'=================================== strProfileInfo= "ServerName" & vbLf & "MailboxName" ' Create a MAPI logon to the specified mailbox.
	 Set objSession= CreateObject("MAPI.Session")
	 objSession.Logon , , False, True, 0, True, strProfileInfo ' Create a container rendering application.
	 Set objRenderApp = Server.CreateObject("AMHTML.application")
	 Set objCRenderer = _
	 objRenderApp.CreateRenderer(CdoClassContainerRenderer)
'There are two ways to format data with a CDO Rendering application:
' 1 - By setting a format to a field of the message and rendering
'	 that field a certain way depending on the value of the
'	 information.
' 2 - Render a column of data all in the same fashion. ' format importance field
	 Set cFormat = objCRenderer.Formats.Add("PR_Importance")
' The images below must exist on the server where the script is located.
	 Set cPattern = cFormat.Patterns.Add(0,"<img src=low.gif>")
	 Set cPattern = cFormat.Patterns.Add(1,"<img src=invisibl.gif>")
	 Set cPattern = cFormat.Patterns.Add(2,"<img src=urgent.gif>") ' Format Class field.
	 Set cFormat = objCRenderer.Formats.Add("PR_Message_Class")
	 Set cPattern = cFormat.Patterns.Add("IPM.Note", _
		 "<img src=newmail.gif>")
	 Set cPattern = cFormat.Patterns.Add("IPM.AppointmentItem", _
		 "<img src=newappt.gif>")
	 Set cPattern = cFormat.Patterns.Add("IPM.Post","<img src=post.gif>")
	 Set cPattern = cFormat.Patterns.Add("IPM.Contact", _
		 "<img src=meeting.gif>") ' Format Attachment field.
	 Set cFormat = objCRenderer.Formats.Add("PR_HASATTACH")
	 Set cPattern = cFormat.Patterns.Add(0,"<img src=invisibl.gif>")
	 Set cPattern = cFormat.Patterns.Add(1,"<img src=papclip.gif>") ' Set the datasource to the appropriate folder.
' This will set the container to be rendered to the Sent items folder
	 objCRenderer.DataSource= _
	 objSession.GetDefaultFolder(CdoDefaultFolderSentItems).Messages
' Use the default predefined view.
	 Set objTableView = objCRenderer.Views(1) ' Add body column and render it in blue.
' set objColumn = _
' objTableView.Columns.Add("Body", "PR_Body" ,150, 8 ,8) ' objColumn.RenderUsing = "<font color=blue>%value%</font>" 'Render the object
	Response.write(objCRenderer.Render(CdoFolderContents)) 'Clean up Session & Rendering Objects.
	set objsession = nothing
	set objrenderapp = nothing
	set objCRenderer = nothing %>
</BODY>
</HTML>
Is it need to change the ServerName and the MailBoxName?

Normally how the servername and mailboxname look like? is it in IP format?
superman2004 is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 01-17-2005, 10:16 PM
Bullschmidt's Avatar
Average Talker

Posts: 24
Location: USA
Trades: 0
If your address book doesn't change substantially very often, here is something you could do every now and then (assuming that you can make an ASP page that runs off of an Access database).

To export an Outlook Express address book to an Access database perhaps do this:

In Outlook Express | File | Export | Address Book | Text File (Comma Separated Values)

And then in your Access database | File | Get External Data | Import...
__________________
J. Paul Schmidt
www.Bullschmidt.com - Freelance Web and Database Developer
www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips
Bullschmidt is offline
Reply With Quote
View Public Profile Visit Bullschmidt's homepage!
 
Reply     « Reply to How to show my Outlook Express Address book at ASP page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.08471 seconds with 13 queries