473,671 Members | 2,340 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Opening a microsoft word document from within an ASP.Net WebForm

I'm trying to figure out how open a microsoft word document from within an asp.net application. There is information in the web form that I need to merge with the opened document. I can't seem to find any code examples or explanations on how this is done if it's even possible. Has anyone successfully accomplished this task or even tried and if so, how is it done?
Nov 18 '05 #1
2 1725
Office applications have COM interfaces. You would have to use a COM Interop
assembly to interact with Word on the server. The Office COM references can
be found in your Office installation folders.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"terry" <te***@discussi ons.microsoft.c om> wrote in message
news:68******** *************** ***********@mic rosoft.com...
I'm trying to figure out how open a microsoft word document from within an

asp.net application. There is information in the web form that I need to
merge with the opened document. I can't seem to find any code examples or
explanations on how this is done if it's even possible. Has anyone
successfully accomplished this task or even tried and if so, how is it done?
Nov 18 '05 #2
There are a set of Primary Interop assemblies available for office (PIA). I
dont have the link handy but do a search on MSDN or google to find them.
This will provide the reference to your COM interop layer. Within ASP.Net
you will need to adjust the security to allow calling of unmanaged code
though through the .Net security policy config (Control Panel -->
Administrative Tools --> .Net Framework 1.1 configuration)

--
- Paul Glavich
Microsoft MVP - ASP.NET
"Kevin Spencer" <ks******@takem pis.com> wrote in message
news:ui******** ******@tk2msftn gp13.phx.gbl...
Office applications have COM interfaces. You would have to use a COM Interop assembly to interact with Word on the server. The Office COM references can be found in your Office installation folders.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"terry" <te***@discussi ons.microsoft.c om> wrote in message
news:68******** *************** ***********@mic rosoft.com...
I'm trying to figure out how open a microsoft word document from within
an asp.net application. There is information in the web form that I need to
merge with the opened document. I can't seem to find any code examples or
explanations on how this is done if it's even possible. Has anyone
successfully accomplished this task or even tried and if so, how is it done?

Nov 18 '05 #3

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

Similar topics

3
5578
by: Andy Davis | last post by:
I have set up a mail merge document in Word 2003 which gets its data from my Access 2000 database. I want to set up a button on a form that: 1. runs the query to provide the dat for the merge document in Word; 2. opens the document and runs the merge process for the new data. I have managed to write the code to perform step 1 ok, but I'm having trouble with step 2. It opens the word document fine but does not perform the mail merge of...
4
11127
by: Yohancef Chin | last post by:
Hi, Being fairly new to .NET I am looking for a way to call MS Word from an event on a webform, and after the user is finished save that created document to an SQL Server database. Has anyone done this? Does it seem possible? I followed the instructions from a sample on the Microsoft knowledge base but it only seems to work when creating a VB.NET Windows .EXE, not an VB.NET ASP app.
3
6117
by: Yohancef Chin | last post by:
Hi, Being fairly new to .NET I am looking for a way to call MS Word from an event on a webform, and after the user is finished save that created document to an SQL Server database. Has anyone done this? Does it seem possible? I followed the instructions from a sample on the Microsoft knowledge base but it only seems to work when creating a VB.NET Windows .EXE, not an VB.NET ASP app.
1
380
by: ram | last post by:
how do I open a word document within a webform? I need to open the document within the form so the user can edit the document and then click on a button on the form (so that the document is automatically saved to a specified location on the server). thank you!
3
2414
by: John | last post by:
Hi I am using the code given at the end to open a word document from within vb.net. It works fine the first time but the second time I get the error; Unhandled Exception: System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. at Word.ApplicationClass.get_Documents() The error occurs on the line WordDoc = WordApp.Documents.Add(<Template
1
2152
by: ourspt | last post by:
Hi, We are working on an ASP.NET (VB.NET) application and we have a problem opening a word document from our application. When we try to open the word document, we do not get any error message but the system hangs.
2
3372
by: Colin Halliday | last post by:
I have a Word 2003 mail merge main document (form letter) that is linked to another Word document data source for the mail merge. If I open this doc using the Word GUI, it first asks me to confirm that I want to run a query to select the data from the data source file, then it opens the form letter fine. I can preview the merged records and complete a merge to a new document. I have a VB 2006 project (.net framework 2.0) which opens the...
8
6938
by: gazza67 | last post by:
Hi, I want to do something that I thought would be simple but i cant seem to work it out, perhaps someone out there could help me. I want to browse for a file (it will be a word document), save the file name to a string and then at some later stage open that file with word. The operating system will be windows 2000 (dont know if that makes a difference or not).
0
1641
by: =?Utf-8?B?V2FubmFiZQ==?= | last post by:
I am creating a webpage and opening it as a Word document. Problem is that as I create one of the questions, some of the text is not appearing in the document as it should. As I step through it, I can see the text in my string builder variable, but once the page opens as a Word document, that same text is not showing. It seems to only be text that I am displaying as a result of some checkboxes I am trying to write to the page. Can anyone...
0
8473
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
8390
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,...
1
8597
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
8667
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...
1
6222
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4222
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4402
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2048
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.