|
-
Jan 11th, 2005, 07:34 AM
#1
Thread Starter
Lively Member
Help in MS WORD 10.0--Resolved
I am using MS Word 10.0 object in my application, but when I am trying to run the same applicaiton in a different system with different MS Word Version I am getting errors, is there way to solve this problem? Can this be solved my using P&D wizard and installing the application in other system?
Resolved by RobDog888 and thanks to NeedSomeAnswers too
Last edited by kota_balaji; Jan 12th, 2005 at 11:36 AM.
Reason: Resolved
-
Jan 11th, 2005, 07:47 AM
#2
Re: Help in MS WORD 10.0
I have had a similar problem in the past, and it is because the 10.0 object library is only compatible with Word xp (2003)
For Word 2000 - you need the 9.0 object library.
If all your users are on Word 2000 then you can just remove the 10.0 object library before compiling the .exe & add the 9.0 object library.
It's a little more bother if your users have both versions of word.
I think that using the CreateObject() function you can get round this compatibility issue, but it has been a while since i have done it, and can't quite remember how (plus dont have my examples with me)
Maybe someone else here can remember how!!!
-
Jan 11th, 2005, 11:57 AM
#3
Re: Help in MS WORD 10.0
You can use late binding. You remove the reference to word and declare all
your Word objects as Object. You may want to make sure that you are not
using any methods or properties that are only available to one version. you
need to make your app compatible across multiple version of Word.
VB Code:
'Example of late binding
Private Sub Command1_Click()
Dim oApp As Object
Dim oDoc As Object
Set oApp = CreateObject(,"Word.Application")
oApp.Visible = True
Set oDoc = oApp.Documents.Open("D:\Test.doc")
oDoc.PrintOut
oDoc.Close False
oApp.Quit
Set oDoc = Nothing
Set oApp = Nothing
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 12th, 2005, 07:56 AM
#4
Thread Starter
Lively Member
Re: Help in MS WORD 10.0
Hi RobDog888, thanks for the help. but unfortunately, when i trying to execute your code, i am getting an error "Arugment not optional" in
Set oApp = CreateObject(,"Word.Application")
please, help me.
-
Jan 12th, 2005, 11:15 AM
#5
Thread Starter
Lively Member
Re: Help in MS WORD 10.0
Sorry RobDog888, it was my silly mistake
i think it should be
VB Code:
Set oApp = CreateObject("Word.Application")
Everything works perfect, thank you very much Rob, if possible can tell me, how to hide MS WORD, when executing MS WORD opens at the back ground, how can we hide that. MS Word is opening when creating oApp object, how can we hide that.
-
Jan 12th, 2005, 12:04 PM
#6
Re: Help in MS WORD 10.0--Resolved
Is the best that can be done.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|