Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / September 2003

Tip: Looking for answers? Try searching our database.

Error using deployed Windows application using Word

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Stegman - 14 Sep 2003 14:34 GMT
In my Windows application I use the following code:
"Try
 WordApp = New Word.ApplicationClass()
 WordDoc = WordApp.Documents.Open(txtWordDoc.Text)
 WordApp.Visible = True
Catch ex As Exception
 MessageBox.Show(ex.Message.ToString)
 Exit Sub
End Try"

On my development PC (XP + VS.NET Pro) this works fine. I
created a setup project from the application, but on eny
other system it fails at the above code with: Onject
reference not set to an instance of an object.

I put the Try.catch block in to find the location of the
error.
Do I need to do anything extra to deploy this application?

Thanks in advance,

John
Phil Wilson - 14 Sep 2003 16:13 GMT
You might be missing the interop DLL for Word. Either you're using a primary
interop assembly from MS, or you added a reference to Word, and that DLL
needs to be deployed.
Signature

Phil Wilson [MVP Windows Installer]

> In my Windows application I use the following code:
> "Try
[quoted text clipped - 18 lines]
>
> John
John Stegman - 14 Sep 2003 19:44 GMT
Here is what I alreday did before sending the previous
post. I created a setup project. In this setup project
Interop.word.dll is included. After installing the
program with this setup Interop.word.dll was placed in
the startup directory of the application. When the
problem occured I presumed it was not registered so I
tried to with: regsvr32 Interop.word.dll. But then I got
the message:
interop.word.dll was loaded, but the dllRegisterServer
entry point was not found.
DllRegiserServer may not be exported, or a corrupt
version of interop.word.dll may be in memory. Consider
using PView to detect and remove it.
I figure I need to do something else in or with my
deployment project, but I just don't know what?!

Gtz,

John
>-----Original Message-----
>You might be missing the interop DLL for Word. Either you're using a primary
>interop assembly from MS, or you added a reference to Word, and that DLL
>needs to be deployed.
John Stegman - 15 Sep 2003 12:44 GMT
I partly solved the problem myself. After testing the
program on a machine with exactly the same operating
system (Win XP) and Offcie version (XP), I realised that
referencing Word XP on a machine with Word 2000 doesn't
work. So now I have to find a way to reference different
versions of Word from my application?! Because the end-
users have Word2000 or Word XP.

Grtz,

John

>-----Original Message-----
>Here is what I alreday did before sending the previous
[quoted text clipped - 24 lines]
>
>.
John Stegman - 15 Sep 2003 14:17 GMT
The answer to my last question is: Use latebindig!!
Instead of using:
Dim WordAp as new word.Application
WordApp = New Word.ApplicationClass()
to use the reference to the version of the Microsoft Word
Object Library in your references
You use:
Dim WordApp As object
WordApp = CreateObject("Word.Application")
In the latter case the program seeks the word library at
runtiem and gets the right Word object library. At least
that is how I understand it.
Also see:
http://www.mvps.org/word/FAQs/InterDev/EarlyvsLateBinding.
htm for more information.

Grtz,

John

>-----Original Message-----
>I partly solved the problem myself. After testing the
[quoted text clipped - 39 lines]
>>
>.
Phil Wilson - 15 Sep 2003 19:35 GMT
Late binding is very convenient, that's true, it saves a lot of the grief that
you saw.
Signature

Phil Wilson [MVP Windows Installer]
----

> The answer to my last question is: Use latebindig!!
> Instead of using:
[quoted text clipped - 60 lines]
> >>
> >.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.