A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

The operation failed due to a registry or installation problem. Restart Outlook and try again.



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 6th 07, 06:23 AM posted to microsoft.public.outlook.program_addins
Dhananjay
external usenet poster
 
Posts: 33
Default The operation failed due to a registry or installation problem. Restart Outlook and try again.


Hello Forum,
I am writing my COM-Addin from VB 2005 for office XP. Now as ItemSent
event's cancel is not working for office XP (http://
support.microsoft.com/kb/830519,) I have written the code for helper
class in my Connect class (Shared Addin's connect class). Now my
ItemSent event's Cancel is working perfectly.
But main thing is that, I am cancelling the ItemSend and I am
writing my code to create my custom mailitem in ItemSend event,
filling that custom mailitem with some properties & saving that
mailitem in SentItems folder (without actually sending it).
My code snippet is as follows -

' This is my button on the explorer that opens a custom mailitem
Private Sub cmdBarButton_Click(ByVal Ctrl As
Microsoft.Office.Core.CommandBarButton, ByRef CancelDefault As
Boolean) Handles cmdBarButton.Click
Try
MyMailItem =
TryCast(myOut.Session.GetDefaultFolder(OlDefaultFo lders.olFolderInbox).Items.Add(myCustomForm),
MailItem)
Catch ex As System.Exception
MsgBox("Exception while creating mailitem - " &
ex.Message)
End Try
If MyMailItem IsNot Nothing Then
MyMailItem.To = "
Try
MyMailItem.Display()
Catch ex As System.Exception
MsgBox ("Exception while displaying the form - " &
ex.Message)
Marshal.ReleaseComObject(MyMailItem)
MyMailItem = Nothing
End Try
Else
MsgBox ("Mail item can not be initialized")
End If
MyMailItem = Nothing
End Sub

'And This is my ItemSend event
DispId(61442) _
Public Sub ItemSend(ByVal Item As Object, ByRef Cancel As Boolean)
If TypeOf Item Is MailItem Then
If Item.MessageClass.ToUpper.ToString =
myCustomForm.ToUpper.ToString Then
Cancel = True
MyMail = Item
SendMailInBackground(MyMail)
End If
End If
End Sub

And in SendMailInBackground() procedure I am just creating a Sentitem
mail.

I get Exception - "The operation failed due to a registry or
installation problem. Restart Outlook and try again. If the problem
persists, please reinstall." at the line MyMailItem.Display()
Also some times I am getting the error "DisconnectedContext was
detected" at the line MyMailItem =
TryCast(myOut.Session.GetDefaultFolder(OlDefaultFo lders.olFolderInbox).Items.Add(myCustomForm),
MailItem)
Please help me.

Thanks in advance,
Dhananjay

Ads
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP! The operation failed due to a registry or installation probl Dylan Outlook - Installation 0 March 13th 07 02:29 AM
Retrieve email problem: "The operation failed" HH Outlook - General Queries 1 January 12th 07 11:24 PM
The Operation Failed because of a registry or installation problem Steven T Cameron Outlook - Installation 1 November 14th 06 02:59 AM
installation or registry problem CORKIMKOER Outlook - Installation 1 August 25th 06 07:16 PM
operation failed after installation Bob I Outlook - Installation 0 February 15th 06 08:21 PM


All times are GMT +1. The time now is 09:29 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.