ASP.NET(vb.net) & Connect to Word Application - This article example scripts you will learn how to Connect between ASP.NET to Word.Application.
ShotDev Focus:
- ASP.NET(vb.net) & Connect to Word Application
Example
AspNetConnectWord.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="AspNetConnectWord.aspx.vb" Inherits="AspNetConnectWord" %> <html> <head runat="server"> <title>ShotDev.Com Tutorial</title> </head> <body> <form id="form1" runat="server"> <asp:Label ID="lblText" runat="server"></asp:Label> </form> </body> </html>
AspNetConnectWord.aspx.vb
Imports Microsoft.Office.Interop.Word Public Class AspNetConnectWord Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim WrdApp As Microsoft.Office.Interop.Word.Application Try WrdApp = New Microsoft.Office.Interop.Word.Application Me.lblText.Text = "Connect to Word.Application" Catch ex As Exception Me.lblText.Text = "Can Not Connect to Word.Application = " & ex.Message End Try WrdApp.Application.Quit() WrdApp = Nothing End Sub End Class
Screenshot