|
Hi, I made a application which connect to microsft outlook via MSMAPI32.DLL.
i have deployed this application in the client machine.
When this application try to access microsoft outlook. it give error :
Creating an instance of the COM component with CLSID {00000010-0000-0010-8000-00AA006D2EA4} from the IClassFactory failed due to the following error: 80040112
I dont know what to do with this problem. I checked all the dependencies of MSMAPI32.DLL. All dependencies are available in the client machine.
Kindly help me.
hi, this is anirudh
|
|
|
|
|
Why are connecting to Outlook via MSMAPI32.DLL? Why not reference the Outlook APIs?
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Dear Steve,
Thank you so much for quick response. There is always some problem occurs when using vb6 component in vb.net. However Outlook APIs can be used, but it does not solve the problem regarding using vb6 component to .net.
Kindly guide me so that i am able to use this dll in VB.Net.
hi, this is anirudh
|
|
|
|
|
First off, I'm in the "skilled hobbyist" category - I don't do this for a living and my apps are not commercial apps. However, I've distributed some of my apps to colleagues who in some cases find them very useful. My question (when I get to it) will concern: how do I make sure what works on my machine will work on their machines?
I am coding an app that is working fine for me. Its job is just to create "recipes" for mixing chemical solutions. Really it's a glorified calculator, but with time-savers like allowing you to save molecular weights of commonly-used chemicals, jumping to websites that contain chemistry databases, organizing your library of chemicals by user-defined groupings, etc.
One can just run the calculations and write down the results. But I decided to provide a way to store recipes in a log - you can run several calculations and build a document of the recipes for saving or printing. Rather than code a mini word processor, I decided I'd just have the code open Microsoft Word. Now, to questions:
In my program I declare a global variable:
Public log As Word.Application
I noticed if I declared this "as new" then Word began running in the background. So in the File... Open log even of the menu, the code is:
btnCopyToLog.Enabled = True
Try
log.Visible = True
Catch
Dim openit As New Word.Application
log = openit
log.Visible = True
openit = Nothing
End Try
log.Documents.Add()
I'm doing it this way to get the global variable to reference the Word app. I probably will wrap this all in a Class once I have a clear vision of how it all will work. Right now, the btnCopyToLog Click event has another Try...Catch to write text to the ActiveDocument. The Form Closing event sets log to Nothing.
My question is this: it works for me. But if I send it to another person who doesn't have Microsoft Word 2003, what will happen? Will the app fail to run because there is a reference to the Microsoft Word 11.0 library? Or will the app run but throw a run-time error at the "log" variable declaration? (Is this fatal since declarations can't be error trapped?) Or will the app only throw an error when the variable is used? (In which case I can error trap it.) What if the user has a newer or older version of Word?
Thank you in advance for any guidance you can offer. I can always make my own log window with a rich text box if need be. But I'd also like to learn more about the issues involved, since I plan another program that will rely on Excel.
|
|
|
|
|
Steven,
IIRC, I believe it is required that Word be installed on the computer for that to work. I used to have that documented somewhere but I can't find it right now.
|
|
|
|
|
I'm sure that's true! What I'm wondering is what the behavior of the program will be. If there's a way for the program to discover if Word is on the machine I'd like to programmatically provide a different option to the user. (E.g., if a Word command fails then copy the text that would have gone to word to the clipboard, or generate an appending log text file.)
UPDATE:
Won't matter for the question I don't think, but I've encapsulated all of the Word operations into its own class.
|
|
|
|
|
Ah! Ok, I think (again from my bad memory) that it will crash (trying to load the reference). I didn't try this[^], but if it works, you might could check if Word is installed first. Actually, I don't have Word here so I will try it and let you know...
Update:
It hosed with: System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80040154.
I hope this is helpful and that I didn't completely miss your question. I've done it before.
modified on Monday, July 21, 2008 2:50 PM
|
|
|
|
|
Steven St. John wrote: Will the app fail to run because there is a reference to the Microsoft Word 11.0 library? Or will the app run but throw a run-time error at the "log" variable declaration?
It should work until the point of instantiating the new word application. The client computer will need to have Office 2003 or newer installed in order to work.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
The JZ - That link you gave on the Registry function was very helpful!
Paul Conrad - The info you gave me was just what I was looking for, with the bonus info that a Word 2007 user would also be able to run things.
So, this should work:
Public Class SolutionLog
Dim log As Word.Application
Dim m_WordVer As String
Dim m_CanUseWord As Boolean
Public Sub New()
Dim regKey As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.ClassesRoot
Dim regWord As Microsoft.Win32.RegistryKey = regKey.OpenSubKey("Word.Application")
If Not (regWord) Is Nothing Then
Dim regWordVer As Microsoft.Win32.RegistryKey = regWord.OpenSubKey("CurVer")
m_WordVer = regWordVer.GetValue("")
If m_WordVer = "Word.Application.11" Then m_CanUseWord = True
Else
m_WordVer = "Word Not Installed"
m_CanUseWord = False
End If
End Sub
When my program creates an instance of the SolutionLog class upon loading, the registry is checked and m_CanUseWord is set if and only if Word is found and uses Version 11 (I'll add Version 12 to this eventually, and possibly parse the string and use a >= logic). I'll make this value and the m_WordVer value available to the client program as ReadOnly properties. The methods that start Word and type to Word can be error trapped:
If Not(m_CanUseWord) Then
Throw New Exception
Else
log=New Word.Application
End If
The only reason it might not work is the first line:
Dim log As Word.Application
Does that cause an error? Or will it be okay since I never actually create a new Word.Application except in an error-trapped if... then? Since the code is already compiled when it gets to the user's machine, I'm assuming this will not cause an error and my problem is solved.
If I'm Right Then
Thank you all very much!
Else
There must be some way to do this
End If
|
|
|
|
|
Hiii
i want to add a task in windows task scheduler using vb.net 2005.
how i do this.please suggest.
Thanx
~Khatri Mitesh
|
|
|
|
|
|
|
Odd question of the day: Can you have multiple font colors in same text on single statusstriplabel?
I have a status strip with multiple statusstrip labels. I want to produce something like this:
Refresh ("R" displayed as the color Red and "efresh" in black). I tried creating 2 different status labels, but the text is displayed to far apart (even after modifying the alignment and padding). So is it possible to have multiple fonts assigned to different sections of the text within the same label?
I told you..... it's an odd question
|
|
|
|
|
That is not possible with the label control of the System.Windows.Forms namespace. You can create a control that could emulate this and then embed the custom control in the status strip, but other than that I am not aware of any other ways around it.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
|
You should look to use a Rich Text Box control and embed that onto your status bar control
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Got it handled, thanks guys.
modified on Tuesday, July 22, 2008 11:22 AM
|
|
|
|
|
Hi !
I have an object named RemoteDb that is implemented as a web service.
It has a method named RemoteSql than accepts an input string and returns a system.data.datatable with the results.
I've been working for a few days referencing it from VB and all works fine. This morning I have done some modifications to webservice and so, i have rebuilt it.
From explorer, it continues working fine, but when I've updated the web reference from my applicaction (Vb.net IDE), this error has appeared:
Value of type 'RegantsAlgerri.WebReference.RemoteSqlResponseRemoteSqlResult' can not be converted to 'System.Data.DataTable'.
When i call the webmethod RemoteSql() .net environment explains me that return parameter is RegantsAlgerri.WebReference.RemoteSqlResponseRemoteSqlResult. In previous version (before update Web Reference) .net environment tells me that return type was System.Data.DataTable.
Why reference is loaded with this bad return type ?
Regards in advance
|
|
|
|
|
Well its Difficult to say, especially if we dont see the code. but i think you have tempered with the return type when you were doing modification this morning. Lets see how you wrote your function that return that datatable and we can point where the Problem is.
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hello again,
Next description is more aproximated about problem is:
I created a Web Service using .Net 2.0 that has a function that
returns a DataTable. I can test the function from the web page when I access
the .asmx from a browser on localhost and it works.
The problem I have now is when using VS 2005 or VB.Net 2005 Express and creating a web references is
that the proxy created doesn't map the function as returning a DataTable
instead returns some other type of object named xxxxResult where xxxx is the
name of the web service function.
I have another function that returns a DataSet that works perfectly with the web reference although I'd rather use a DataTable since I won't need all the functionality that a DataSet brings.
Anyone have the same problem and found a solution?
|
|
|
|
|
Still until you show us the code, we will not know what is the problem, try to post your code
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Using DataSet and not DataTable as method argument and/or return type, the client application recognizes de types, and so it works.
I've looking other forums, and other people has the same problem.
Solution has not been found, but everybody is using DataSet vs. DataTable.
Microsoft exposes this article, recommendating using DataSets:
http://support.microsoft.com/kb/306134
|
|
|
|
|
Its True , you have to return a dataset.but you must filter it, dont return everything, because you might return a large sum of data that might not be needed by your application and consume a lot of resources
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I build a minimal dataset:
Dim Ds as new DataSet
Ds.Tables.Add(MyTable)
return(Ds)
Thanks for your patient.
|
|
|
|
|
Thats Fine,
what you did is good.
Rememmber Patience is better than Pride, am glad you got your solution rate my post
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|