Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi All,

 

I wrote a sample application to extract the messages and attachments from a .pst file using VB.Net which is working fine. Now i am trying to web service enable this and when i added an operation in .asmx File

 

<WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _

Public Function extractPST(ByVal fileName As String) As String

Dim readPST As ReadPST

readPST = New ReadPST

readPST.readPST(fileName)

Return "success"

End Function

 

And i have a class ReadPST.vb which has the code

 

Sub readPST(ByVal fileName As String)

Dim i As Integer

Dim objOutlook As New Outlook.Application

' Dim objNS As Outlook.NameSpace = objOutlook.Session

Dim myNameSpace As Outlook.NameSpace = objOutlook.GetNamespace("MAPI")

'Dim file As New System.IO.StreamWriter("c:\test.html")

' Add the .pst File to the Name Space

myNameSpace.AddStore(fileName)

...........

 

And when i tried to debug the code i am getting a 500 Error at the Line

Dim myNameSpace As Outlook.NameSpace = objOutlook.GetNamespace("MAPI")

 

How can i resolve this..

 

Thanks a lot

Sateesh

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...