Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Visual Basic 2005 Basics
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 9th, 2007, 05:35 AM
Registered User
Join Date: Dec 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default open word document and insert data

Hello there,

Its been 2 days that i'm trying to open a word document from an aspx page. The code i use is shown below:

'************************************************* *********
Imports WordApp = Microsoft.Office.Interop.Word

 Protected Sub openWord(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim WordApp As New Word.Application
        WordApp.Visible = True
    End Sub
'************************************************* *******

This code runs the winword.exe as a process (i can see it in task manager) but i never get word on my screen.I've imported Microsoft.Office.Interop.Word assemmbly, i've tried using impersonation or the ASPNET account but neither worked.I have given access permissions to all users on winword.exe and I've added the ASPNET account on the Word.Document COM using the DCOMCNFG tool.

Am I missing something here????

Any ideas provided would be helpful

Kostas Lagos
Old August 9th, 2007, 06:31 PM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

When you deploy your web application to a server... and a user browses to the site using firefox in linux, how will MS Word load?

What you are missing is that the server application is not running in a context the user will ever have access to. Unfortunately, this is easily mistaken using a development environment where the server PC is also the client PC.

You could generate a .doc file then stream that back to the client and hope that they'll be able to read the document (i.e. they have a program that knows how to deal with a .doc file), but you can't start msword.exe from your server application code. It just doesn't work that way.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Office Automation- open word document ayazhoda Access VBA 2 November 4th, 2008 12:01 PM
insert word document to DB an read webphp PHP How-To 1 August 10th, 2005 02:34 PM
open, change a excel document from word kareltje Excel VBA 2 February 14th, 2005 11:23 AM
Cannot open Word Document At Client Side leo_ling Classic ASP Basics 6 July 1st, 2004 12:31 AM
How to open word document using ASP and read ksaleemkhan Classic ASP Components 3 April 28th, 2004 04:43 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.