473,772 Members | 3,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need to start word 2003 and show existing rtf doc in VB.Net

Bob
I have the follwing snippet of code, lets me find a document and then open
it, but thw word application does not show up.

I had similara to this in vb6 and it worked, but I can't get it to show in
Vs2005 Vb.Net

Can anyone tell me how to show the word application from within VB.net. I
need this and I need to be able to add a new file.
I'll have two diffrent menu items. the edit existing file and the add new
word file menu.
Here's the snippet I got for the Edit existing file, It doe something but
doesn't show word on screen.

Private Sub mnuOpenAndModWo rd_Click(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles mnuOpenAndModWo rd.Click

Dim Wordfolder As String

Wordfolder = My.Settings.Def aultOriginalTex tFilesFolders

Me.ofdWordDoc.I nitialDirectory = Wordfolder

If ofdWordDoc.Show Dialog() = System.Windows. Forms.DialogRes ult.OK Then

Dim WordFile As String

WordFile = Me.ofdWordDoc.F ileName

Me.Cursor = Cursors.WaitCur sor

Dim word As New Microsoft.Offic e.Interop.Word. Application

Dim doc As Microsoft.Offic e.Interop.Word. Document

Try

doc = word.Documents. Open(WordFile)

doc.Activate()

Catch ex As COMException

MessageBox.Show ("Error accessing Word document.")

End Try

Me.Cursor = Cursors.Default

Else

End If

End Sub

Any help would be appreciated,

Bob


Jun 5 '06 #1
1 1562
RMT

word..Visible = True

"Bob" <bd*****@sgiims .com> wrote in message
news:ed******** ******@TK2MSFTN GP04.phx.gbl...
I have the follwing snippet of code, lets me find a document and then open
it, but thw word application does not show up.

I had similara to this in vb6 and it worked, but I can't get it to show in
Vs2005 Vb.Net

Can anyone tell me how to show the word application from within VB.net. I
need this and I need to be able to add a new file.
I'll have two diffrent menu items. the edit existing file and the add new
word file menu.
Here's the snippet I got for the Edit existing file, It doe something but
doesn't show word on screen.

Private Sub mnuOpenAndModWo rd_Click(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles mnuOpenAndModWo rd.Click

Dim Wordfolder As String

Wordfolder = My.Settings.Def aultOriginalTex tFilesFolders

Me.ofdWordDoc.I nitialDirectory = Wordfolder

If ofdWordDoc.Show Dialog() = System.Windows. Forms.DialogRes ult.OK Then

Dim WordFile As String

WordFile = Me.ofdWordDoc.F ileName

Me.Cursor = Cursors.WaitCur sor

Dim word As New Microsoft.Offic e.Interop.Word. Application

Dim doc As Microsoft.Offic e.Interop.Word. Document

Try

doc = word.Documents. Open(WordFile)

doc.Activate()

Catch ex As COMException

MessageBox.Show ("Error accessing Word document.")

End Try

Me.Cursor = Cursors.Default

Else

End If

End Sub

Any help would be appreciated,

Bob

Jun 5 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
9873
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ********************************** package Celcom.Client;
11
7045
by: Ron | last post by:
Hello, I'm having an aggravating time getting the "html" spewed by Word 2003 to display correctly in a webpage. The situation here is that the people creating the documents only know Word, and aren't very computer savvy. I created a system where they can save their Word documents as "html" and upload them to a certain directory, and the web page dynamically runs them through tidylib using the tidy extension to php4, thus causing the...
20
1977
by: Stephan Golux | last post by:
It seems I have run afoul of an unfixable and acknowledged bug in my beloved access 97 which has no workaround other than to upgrade. Current supported upgrades are 2002 and 2003. 2003 appears to use lots 'o system resources, so I am wondering if I am best to go with the older (2002) version. Any opinions out here? In particular, which version more likely to make the conversion of the 97 databases the least painful? Both upgrades
10
3061
by: Neil | last post by:
An article at http://news.com.com/2100-1012-991694.html?tag=fd_top states: "XML would allow easier interchange of data generated in Office documents with back-end systems or existing Web services." As part of an Access 2000 application, I have to continually parse Word documents and store the parsings in Access tables using Automation to control Word and parse the document. Is there a way that XML would help with that? Thanks.
5
1503
by: Jason James | last post by:
I all, I have a VB.Net app that words just fine when automating MS Word 2003, when Word is part of MS Office Professional edition (even with SP1 installed). However, if I install the app onto a machine wunning MS Word 2003 that is part of MS Office Small Business Edition 2003, it can not load and run the type library needed to perform the automation tasks? I get a system.io.filenotfound exception raised, saying that the specified...
3
4674
by: Chris Davoli | last post by:
I've got a requirement to build a page using MS WORD and then have the page show up on a web site. I know I can do a binary write and open up the WORD document in IE plugin. Don't really want to do this because it displays in the word editor. What I'm looking for is a way to upload the WORD document to the server (I know how to do this using the HTML Upload control) then take the WORD document and run it thru some kind of converter class...
66
5414
by: genestarwing | last post by:
QUESTION: Write a program that opens and read a text file and records how many times each word occurs in the file. Use a binary search tree modified to store both a word and the number of times it occurs. After the program has read the file, it should offer a menu with three choices. the first is to list all the words along with the number of occurences. The second is to let you enter a word, with the program reporting how many times the...
20
4285
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site is structured as an upside-down tree, and (if I remember correctly) never more than 4 levels. The site basically grew (like the creeping black blob) ... all the pages were created in Notepad over the last
4
3409
by: shelley_2000 | last post by:
What is the best approach to collect and load Employee Resume Data from External Employees who may not have Microsoft access? If is likely they will have Microsoft Word, but not Microsoft Access. Is there any type of form/template that I could send to employees to fill out and send back for me to import into the Access Database? Or should I consider a Word Forms with some type of data extractor for loading into Access database? and if...
0
9620
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9912
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8934
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.