Last post Dec 20, 2013 01:57 AM by SamJsr
Dec 18, 2013 07:45 AM|rakesh121189|LINK
just a little background i have iis running on one of the systems and have lotus notes installed on both server machine and client machine. what i want achieve is send and email from clients lotus notes which is currently open.
I am using the following code but unable to understand where is the fault.
Dim NSession As Object
Dim NDatabase As Object
Dim NUIWorkSpace As Object
Dim NDoc As Object
Dim NUIdoc As Object
'Application.ScreenUpdating = False
'Application.DisplayAlerts = False
NSession = CreateObject("Notes.NotesSession")
NUIWorkSpace = CreateObject("Notes.NotesUIWorkspace")
NDatabase = NSession.GetDatabase("", "")
If Not NDatabase.IsOpen Then
NDoc = NDatabase.CreateDocument
.sendto = TextBox1.Text 'reading from excel sheet
.CopyTo = TextBox2.Text 'reading from excel sheet
.Subject = "PUT YOUR SUBJECT HERE"
.body = "Hello All," & vbNewLine & vbNewLine & _
"Please find the attached so and so....." & vbNewLine & vbNewLine & _
"Image 1" & vbNewLine & _
"Image 2" & vbNewLine & _
NUIdoc = NUIWorkSpace.EditDocument(True, NDoc)
NUIdoc = Nothing
NDoc = Nothing
NDatabase = Nothing
NUIWorkSpace = Nothing
NSession = Nothing
Error that i get is
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Exception: Cannot create ActiveX component.
Line 12: 'Application.ScreenUpdating = False
Line 13: 'Application.DisplayAlerts = False
Line 14: NSession = CreateObject("Notes.NotesSession")
Line 15: NUIWorkSpace = CreateObject("Notes.NotesUIWorkspace")
Line 16: NDatabase = NSession.GetDatabase("", "")
Source File: C:\inetpub\wwwroot\email\compose.aspx.vb Line: 14
[Exception: Cannot create ActiveX component.]
Microsoft.VisualBasic.Interaction.CreateObject(String ProgId, String ServerName) +208
compose.Button1_Click(Object sender, EventArgs e) in C:\inetpub\wwwroot\email\compose.aspx.vb:14
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9554250
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929
Could someone help me with this please
Dec 20, 2013 01:57 AM|SamJsr|LINK
It seems you are having problem with session.There are multiple approaches to solve this problem.
1.You can use Lotus.NotesSession but since you are interaction with Notes UI it
won't be much of a help. But, u can try it just for the sake of trying.
2.Make sure you have rights to open and read mailbox.
Now, If none of these is really working for you. There is another way that is bit risky. You have to try reloading your Registry entries.
(PROCEED AT YOUR OWN RISK)
I would like to make you aware that manipulating registries are risky.
1. Find notesw32.reg in the Lotus/Notes Directory
2. Click on the notesw32.reg and click yes to update registry.
1. Go to Start->Run->Regedit.
2. File->Import -> Browse to notesw32.reg and update it.
Now, try your code.
Hope it works!