[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

programmatically print outlook attachments (server-side)

Posted on 2004-03-26
4
Medium Priority
?
533 Views
Last Modified: 2010-03-05
Is it possible to programmatically print outlook attachments (server-side) for an email account?
0
Comment
Question by:froggy_bill
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 1

Expert Comment

by:ktuffner00
ID: 10691502
you can by creating a sript or by using a third party tool to do this, but ive never done it.  check the microsoft newsgroups for exchange or slipstick.com.  Im sure someone has done it.  The best would be a script in my way.  Ive also heard from other people in the field about third party software that does this
0
 
LVL 10

Expert Comment

by:OneHump
ID: 10691744
You definately would have to program.  I think the the operative term here is "server side".  The only way to do this server side is by running the app, along with a MAPI subsystem (client) on the server.  That may not be desireable for performance reasons.  You could definately run your app against the server from a remote location.

You can definately do this though.  The best approach would be one of two things:

1.  An event script that hooks into a print control.

2.  A VB script or application that uses a MAPI control to pull down messages, place them into an array and print using a print control.

None of this is hard.  The hard part is doing this if you don't know VB or VBScript.

OneHump
0
 
LVL 2

Expert Comment

by:timiano
ID: 10712974
Dim Rec
Dim Rs
Dim strURL
Dim strQ
Dim strSubj
Dim DomainName
Dim strLocalPath
Dim UnreadCount

Set Rec = CreateObject("ADODB.Record")
Set Rs = CreateObject("ADODB.Recordset")

DomainName = "domain.internal"
strUser = "usernam"
strPwd = "password"

strLocalPath = "MBX/" & strUser & "/inbox"

strURL = "file://./backofficestorage/" & DomainName & "/" & strLocalPath
'Response.Write "strURL= " & strURL


Rec.Open strURL,,,,,strUser,strPwd

' Build the SQL query for the messages.
strQ = "select "
strQ = strQ & " ""urn:schemas:mailheader:date"""
strQ = strQ & ", ""urn:schemas:httpmail:to"""
strQ = strQ & ", ""urn:schemas:httpmail:from"""
strQ = strQ & ", ""urn:schemas:mailheader:subject"""
strQ = strQ & ", ""urn:schemas:mailheader:received"""
strQ = strQ & ", ""urn:schemas:httpmail:read"""
strQ = strQ & ", ""DAV:contentclass"""
strQ = strQ & ", ""DAV:href"""
strQ = strQ & " from scope ('shallow traversal of "
strQ = strQ & Chr(34) & strURL & Chr(34) & "')"
'strQ = strQ & " WHERE ""urn:schemas:httpmail:hasattachment"" = true"

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile("C:\TextFileToLogOutputTo.log")

' Open the recordset.
Rs.Open strQ, Rec.ActiveConnection

Rs.MoveFirst
Unreadcount = 0

' Loop through all of the messages in the recordset and format them in a table.
Do Until Rs.EOF

objFile.WriteLine Rs.Fields("urn:schemas:httpmail:from").Value & "," & _
      Rs.Fields("urn:schemas:httpmail:to").Value & _
      Rs.Fields("urn:schemas:mailheader:subject").Value & _
      Rs.Fields("urn:schemas:mailheader:date").Value & _
      Rs.Fields("urn:schemas:mailheader:date").Value & _
      Rs.Fields("DAV:contentclass").Value & _
      Rs.Fields("DAV:href").Value
Rs.MoveNext


' Close the record and recordset.
Rs.Close
Rec.Close

You have to use this logged on as the particular user, or as a user with full mailbox access to the account in question.  This will output to a text file that you specify.  I have used this for other purposes before, but with different criteria.  http://msdn.microsoft.com/library/en-us/cdosys/html/_cdosys_schema_httpmail.asp explains the rest of the fields that can be accessed via ADO/CDO.

Timiano
0
 
LVL 2

Accepted Solution

by:
timiano earned 2000 total points
ID: 10712978
Oh, and take out the  ' I put on the line with the hasattachment query.....sorry!
0

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Know the reasons and solutions to move/import EDB to New Exchange Server. Also, find out how to recover an Exchange .edb file and to restore the file back.
If something goes wrong with Exchange, your IT resources are in trouble.All Exchange server migration processes are not designed to be identical and though migrating email from on-premises Exchange mailbox to Cloud’s Office 365 is relatively simple…
This video discusses moving either the default database or any database to a new volume.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question