Hi, i posted a thread last week but i can't seem to find it.

I had a problem of making my program work with office 2000 and office 2003.

My computer has office 2003 and the majority of computers have office 2000.

How do i make my word code become independent of office 2000 or 2003.

Someone said that i need to change:

VB Code:
  1. Dim objwdapp As Word.Application
  2. Dim objwddoc As Word.Document
  3. Dim objwdrange As Word.Range

to something like dim objwdapp as object. Do i do that for document and range?

If i build my program on an office 2000 computer then it works for any computer regardless of office model. However this is awkward for me as i have office 2003 and i can't keep using another computer when i need to make changes.

Can someone help please?

VB Code:
  1. Sub printinvoice()
  2. Dim counter As Integer
  3. counter = 0
  4.  
  5.  
  6.    cmdprint.Enabled = False
  7.    mnufileprint.Enabled = False
  8.    StatusBar1.Panels(2).Width = 3400.44
  9.    StatusBar1.Panels(4).Visible = True
  10.  
  11.    [B]Set objwdapp = New Word.Application[/B]
  12.  
  13.    If txtinvoicetype.Text = "SI" Then
  14.       Set objwddoc = objwdapp.Documents.Add("\\Exchange_svr\Globals\Software\Invoice\Invoice.dot")
  15.    ElseIf txtinvoicetype.Text = "SC" Then
  16.       Set objwddoc = objwdapp.Documents.Add("\\Exchange_svr\Globals\Software\Invoice\CreditNote.dot")
  17.    End If
  18.  
  19.    objwdapp.Visible = False