ok guys i use Visual basics express edition 2008. What i need help with is code for opening an already saved (one that i created) microsoft word document using a button in VB. PLz do comment 2 help. Thankz in advance.
Printable View
ok guys i use Visual basics express edition 2008. What i need help with is code for opening an already saved (one that i created) microsoft word document using a button in VB. PLz do comment 2 help. Thankz in advance.
Although you want to opena word doc, I think you need to post in the VB.Net forum.
as a guess as I haven't done much in .Net, you'd need to reference the office object and access all the methods and properties through your objects.
ie create a word application, using the reference to it, open a doc, and using the reference to that do what you need to for printing/updating the doc.
There should be examples at the top of the .Net forum (or links to).
Once you have some code that doesn't work, post up in there for advice.
Good luck
check the tutorial post at the top of this forum for automating office applications
there is tutorial on working from vb.net as well
Moved To VB.NET
just give the reference of Office 11.0 and word 11.0 namesapce from COM
imports microsoft.office.interop.word
it will open your saved file.Code:dim objApp as new Word.Application
dim objDoc as new Word.Document
objApp.Documents.Open("\\Word file path")
objApp.visible = true
regards