473,473 Members | 2,304 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How can I open a Word document from my VB application?

1 New Member
I know that exists another topic on this subject and I've read it but for me doesn't work

Expand|Select|Wrap|Line Numbers
  1. Dim wrdApp As New Word.Application
  2.         wrdApp.Documents.Open("E:\My Documents\exemplu\exemplu.doc")
  3.         wrdApp.Visible = True 
My error is that word.application is not defined.

Can someone help me? I'm using VB2010

Thanks,
Codruta
May 10 '11 #1
2 1095
Guido Geurs
767 Recognized Expert Contributor
You can in VB6 open a program by using the "Shell" command and give the path of the program like this:

Expand|Select|Wrap|Line Numbers
  1. Dim Retval
  2. Retval = Shell("C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE C:\temp\NewDocument.doc", vbMaximizedFocus)
May 13 '11 #2
ToniKati
1 New Member
Hi, are you maybe missing a reference to a Word Interop?
Expand|Select|Wrap|Line Numbers
  1. Imports Microsoft.Office.Interop.Word
Sep 12 '13 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Vikas Kumar | last post by:
how to open word document and pdf file in aspx page
0
by: Niyazi | last post by:
Hi, I created application that store the data in SQL SERVER that reside on network. The client also use this application to access the resources provided with application. But is the client want...
2
by: Alan T | last post by:
In my C# application, I want to open a Word document using the code from the Help: using Microsoft.Office.Interop.Word; object readOnly = true; object fileName = @"C:\Test\NewDocument.doc"; ...
10
by: Antoine De Groote | last post by:
Hi there, I have a word document containing pictures and text. This documents holds several 'ABCDEF' strings which serve as a placeholder for names. Now I want to replace these occurences with...
2
by: sbettadpur | last post by:
hello everybody, i want to open word document file in browser, it means there will be one hyperlink if i click(ex: it's file.doc) on that it has to open the file in the browser. thanks
2
by: alok5505 | last post by:
Hi All , I am new to Mobile development. I want to open word document in mobile control. Also I should be able to edit and save it. Is it possible to do it ? I am using Microsoft .NET...
1
by: shanmugamit | last post by:
i want open word document in frame but its ask open or save file..not open in frame....here is my code <frameset cols="120,*"> <frame src='sample.html'> <frame name='openfile' src='sample.doc'>...
7
by: Peter | last post by:
ASP.NET 2.0 I am trying to open a Word document and Excel document from a dialog web page, what's the best way to do that? I have tried the following: Response.Clear();...
7
by: Peter | last post by:
I have the following code which is executed from a modal web page - it works fine on most, but on some computers the Word loads into memory but never displays. This occurs with IE6 and IE7, but...
2
by: saketmayur | last post by:
Hi , I have write the following code to open word document on server using Microsoft.Office.Interop.Word; string DocPath = System.Configuration.ConfigurationManager.AppSettings; ...
0
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,...
0
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...
1
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...
0
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...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
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.