|
-
Nov 24th, 2009, 06:27 PM
#1
Thread Starter
New Member
Opening a saved microsoft word document
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.
-
Nov 25th, 2009, 04:57 AM
#2
Re: Opening a saved microsoft word document
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
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Nov 25th, 2009, 05:26 AM
#3
Re: Opening a saved microsoft word document
check the tutorial post at the top of this forum for automating office applications
there is tutorial on working from vb.net as well
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Nov 25th, 2009, 06:51 AM
#4
Re: Opening a saved microsoft word document
-
Nov 25th, 2009, 07:38 AM
#5
Hyperactive Member
Re: Opening a saved microsoft word document
just give the reference of Office 11.0 and word 11.0 namesapce from COM
imports microsoft.office.interop.word
Code:
dim objApp as new Word.Application
dim objDoc as new Word.Document
objApp.Documents.Open("\\Word file path")
objApp.visible = true
it will open your saved file.
regards
MCP, MCTS, Microsoft MVP [Asp.Net/IIS]
For more .NET development tips visit .NET Tips
If the post is useful then please  Rate it
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|