Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Objects

 AfterLogic Forum : MailBee.NET Objects
Subject Topic: Error in MsgConvert.EmlToMsg Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
RobFarley
Newbie
Newbie


Joined: 24 November 2010
Online Status: Offline
Posts: 1
Posted: 24 November 2010 at 7:40am | IP Logged Quote RobFarley

I am getting en error when using the MsgConvert.EmlToMsg function, the error message is "Length cannot be less than zero. Parameter name: length".

The relevant lines of code are as follows:

Public Shared Sub SaveItemAsMsgFile(ByVal sMsgPath As String, ByVal sEMLPath As String)
    Dim conv As MailBee.Outlook.MsgConvert = New MailBee.Outlook.MsgConvert
    conv.EmlToMsg(sEMLPath, sMsgPath)
End Sub

sEMLPath is the full file path of the EML file, sMsgPath is the path the MSG file will be saved to (same path, same filename, different extension). When the error occurs a zero-size MSG file is created in the correct location.

The full stack trace is as follows:

   at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   at System.String.Substring(Int32 startIndex, Int32 length)
   at MailBee.Outlook.MsgConvert.a(String A_0)
   at MailBee.Outlook.MsgConvert.a(MailMessage A_0, Stream A_1, Boolean A_2)
   at MailBee.Outlook.MsgConvert.a(MailMessage A_0, String A_1, Boolean A_2)
   at MailBee.Outlook.MsgConvert.a(String A_0, String A_1, Boolean A_2)
   at MailBee.Outlook.MsgConvert.EmlToMsg(String emlFilename, String msgFilename)
   at ExchangeSync.Globals.SaveItemAsMsgFile(String sMsgPath, String sEMLPath) in C:\Development\Dev\Exchange Sync\Globals.VB:line 338

The error is obviously occurring within MsgConvert but gives no indication as to what is actually causing it, I cannot see what (if anything) I can do to correct this. Does anybody have any suggestions? I am using the latest available version of the .NET objects (v6.5).
Back to Top View RobFarley's Profile Search for other posts by RobFarley
 
administrator
AfterLogic Support
AfterLogic Support


Joined: 10 November 2003
Online Status: Offline
Posts: 22
Posted: 24 November 2010 at 7:57am | IP Logged Quote administrator

You'll get answer in the Helpdesk.
Back to Top View administrator's Profile Search for other posts by administrator
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide