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:
Dim objwdapp As Word.Application Dim objwddoc As Word.Document 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:
Sub printinvoice() Dim counter As Integer counter = 0 cmdprint.Enabled = False mnufileprint.Enabled = False StatusBar1.Panels(2).Width = 3400.44 StatusBar1.Panels(4).Visible = True [B]Set objwdapp = New Word.Application[/B] If txtinvoicetype.Text = "SI" Then Set objwddoc = objwdapp.Documents.Add("\\Exchange_svr\Globals\Software\Invoice\Invoice.dot") ElseIf txtinvoicetype.Text = "SC" Then Set objwddoc = objwdapp.Documents.Add("\\Exchange_svr\Globals\Software\Invoice\CreditNote.dot") End If objwdapp.Visible = False


Reply With Quote