|
-
Oct 6th, 2003, 06:38 AM
#1
Thread Starter
New Member
opening a word document in vb.net
I have 2 problems.
- I have a form and a button.I want to open a word document every time i click on this button.
What do I have to write?
-I want to move a cursor in a textbox located in a form. How can I use Windows API?
-
Oct 6th, 2003, 07:02 AM
#2
Lively Member
can help you with the word section:
add a reference to word..
projects --> add reference --> com tab
in code:
Dim oWord As New Word.Application
'application
oWord.Documents.Open(Application.StartupPath & "\china.doc")
oWord.WindowState = Word.WdWindowState.wdWindowStateMaximize
oWord.Visible = True
when you close the app make sure to
run this code as well or else your'll get 100 winword.exe's running in memory.
oWord.Documents.Close()
oWord.Quit()
oWord = Nothing
Confusios say "Man who run in front of car get tired."
-
Oct 17th, 2003, 09:45 AM
#3
Thread Starter
New Member
Hello!
It doesn't work because I have no reference to word.
Do you have another idea?
Thank you for understanding.
-
Oct 18th, 2003, 02:44 PM
#4
Lively Member
A suggestion to your problem
Originally posted by sandrino
Hello!
It doesn't work because I have no reference to word.
Do you have another idea?
Thank you for understanding.
Try begging one of your programmer friends to share the main DLL with you.
DannyJoumaa
Advanced VB6 Programmer
Intermediate-Advanced VB .NET Programmer
Intermediate C# Programmer
Intermediate Win32 Developer
Beginner Mac OS X Developer
Contact: [email protected]
Favorite Sayings:
"Every time you open your mouth, you prove your an idiot."
"God is a programmer. Satan is a bug. Life is debugging."
-
Oct 18th, 2003, 02:54 PM
#5
This will open the doc file with whatever application is associated with that extension.
VB Code:
Process.Start(Application.StartupPath & "\china.doc")
If it gives you trouble then Process is in the System.Diagnostic namespace.
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
|