Results 1 to 6 of 6

Thread: Help in MS WORD 10.0--Resolved

Hybrid View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2004
    Location
    Brussels
    Posts
    104

    Resolved 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

  2. #2
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,657

    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!!!

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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:
    1. 'Example of late binding
    2. Private Sub Command1_Click()
    3.  
    4.     Dim oApp As Object
    5.     Dim oDoc As Object
    6.  
    7.     Set oApp = CreateObject(,"Word.Application")
    8.     oApp.Visible = True
    9.     Set oDoc = oApp.Documents.Open("D:\Test.doc")
    10.     oDoc.PrintOut
    11.     oDoc.Close False
    12.     oApp.Quit
    13.     Set oDoc = Nothing
    14.     Set oApp = Nothing
    15.  
    16. 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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Oct 2004
    Location
    Brussels
    Posts
    104

    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.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Oct 2004
    Location
    Brussels
    Posts
    104

    Re: Help in MS WORD 10.0

    Sorry RobDog888, it was my silly mistake

    i think it should be

    VB Code:
    1. 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.

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Help in MS WORD 10.0--Resolved

    VB Code:
    1. oApp.Visible = False
    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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
  •  



Click Here to Expand Forum to Full Width