473,804 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to catch a "word not installed" error?

I have written a small vb.net app that creates a Word and an Excel
file. I referenced Word, Excel and Office as COM-components.

The app does not work on a pc where Word or Excel are not installed.
According to this article:
http://www.devcity.net/Articles/89/1/spellcheck.aspx I added a
try/catch, like this:
Imports System.Runtime. InteropServices

Public Class MyApp
Private Sub MakeWordFile
Try
Dim wordApp As New Word.Applicatio n
' ... etcetera
Catch COMExcep As COMException
MessageBox.Show ( _
"Microsoft Word must be installed for this application
" _
& "to run.", "MyApp")
Catch Excep As Exception
MessageBox.Show ("An error has occurred.", "MyApp")
End Try
End Sub
End Class

The VS.NET IDE gives the following build errors:

The referenced component 'Word' could not be found. Could not load the
type library. DLL-bestand is niet geregistreerd.
The referenced component 'VBIDE' could not be found. Could not load the
type library. DLL-bestand is niet geregistreerd.
Type 'Word.Applicati on' is not defined.
and so on

What is wrong here? I thought the Imports
System.Runtime. InteropServices and the Try/Catch would do the job?

--
Amedee

Apr 30 '06 #1
1 1746
Amedee Van Gasse schreef:
The VS.NET IDE gives the following build errors:

The referenced component 'Word' could not be found. Could not load the
type library. DLL-bestand is niet geregistreerd.
The referenced component 'VBIDE' could not be found. Could not load the
type library. DLL-bestand is niet geregistreerd.
Type 'Word.Applicati on' is not defined.
and so on

What is wrong here? I thought the Imports
System.Runtime. InteropServices and the Try/Catch would do the job?


SOLVED!
I changed the reference from "Word" to "Interop.Wo rd"

--
Amedee

Apr 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
16191
by: Microsoft | last post by:
I'm trying to display a word document inside a web page, but everytime I do I get this error: Error Type: Microsoft VBScript runtime (0x800A0046) Permission denied: 'CreateObject' Does anybody know the correct way to do this? I don't want to link to a document, but rather display a word file inside the asp page.
3
5349
by: Greg Andora | last post by:
Hello, I've had an ASP page that worked for at the minimum for a year and now it is acting very odd and I need some help to fix it. What my page does/did is creates a Word.Application object and a new document from a template. It then proceeds to fill in a bunch of the information on the word document using bookmarks and data from a database. Then it saves the document to a directory and sends the user off to go get the new document. ...
2
10247
by: MaxiWheat | last post by:
Hi, I am using a software that uses MS Word to create PDF files. When I try to run the sample code (ASP 3.0), I get an error on this statement : Set oWord = Server.CreateObject("Word.Application") That error says : The call to Server.CreateObject failed while checking permissions. Access is denied to this object.
1
1600
by: Markus Wollny | last post by:
Hello! I'm currently testing deployment of tsearch2 on our forum table. The table is huge in itself - some 2GB of data without the indexes. I have got PostgreSQL 7.4RC2 running on a test machine, installed tsearch2 to my database, added the new column to the table and tried to update it in the recommended fashion: UPDATE ct_com_board_message SET ftindex=to_tsvector('default',coalesce(user_login,'')
1
1401
by: smith flyers | last post by:
i got the following error when compiling the codes.. the name 'word' does not exist in the class or namespace 'SimpleMath.Pig' Can anyone troubleshoot on this . Thank you ////////////////////// using System; namespace SimpleMath
2
3191
by: Claus - Arcolutions | last post by:
I got a word document as a stream, and I want to get the text from the word document. But I cant seem to find anything to use for that purpose. The "Microsoft office ?.object" com reference, only include functionality to read from a file (as far as I know). I looked a little on the structure of the document, but it doesnt seem to have any common structures, especially not if you compare from different office versions.
9
1467
by: John Grandy | last post by:
Open a .sln containing a web-app and receive the "ASP.NET 1.1 not installed .... " error ..... I've never know the root cause of this error. I've always dealt with it by closing the web-app , deleting the contents of the \{web-app}\bin\ directory and re-opening the web-app.
1
16678
by: Phil H | last post by:
I have a VB.NET console application that uses the Excel PIA. I set it up to run on a W2K box through Task Scheduler, under a domain account that has rights to all of the resources the app uses. I can run this application on my local XP machine with no problem. However, on the W2K machine I received a "No printers are installed" error: System.Runtime.InteropServices.COMException (0x800A03EC): No printers are installed. The app sets...
0
2152
by: Vinodsrvk | last post by:
I tried to execute the bellow query for the word "about" in the NARRATIVE field. This narrative field is of CLOB type with NOTNULL SELECT SEARCHID, NARRATIVE FROM S.TBLSEARCH WHERE CONTAINS(NARRATIVE, 'about') >0 /
0
9594
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10089
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5530
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.