Link to home
Start Free TrialLog in
Avatar of MKadric
MKadric

asked on

MS WORD 2010 and 2003 both installed on computer

I use the code below to open a word dot file which the dot file is associated with 2003.  Which is what I want to open with, but 2010 keeps opening... I need to make sure 2003 always opens with the code below..


Public obj As Word.Application
Public wdApp As Word.Application
Public wdDoc As Word.Document      

      Set wdApp = CreateObject("word.application")
            Set wdDoc = wdApp.Documents.Open(strFilename)
            wdApp.Visible = True
            wdApp.WindowState = wdWindowStateNormal
            wdApp.Activate
            wdDoc.SaveAs strFilename
           
            objRecSet.Fields("Document Path") = strFilename
            objRecSet.Update

ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MKadric
MKadric

ASKER

Is there a way to test for  Word.Application.11. Word.Application.10 amd so on... Because now with the statment above a get a run time error because I do not have 2003 installed
I don't know of one. I suggest that you trap the error.
Avatar of MKadric

ASKER

Worked like a charm... Thanks