web 2.0

ASP.NET(vb.net) & Connect to Word.Application

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

ASP.NET(vb.net) & Connect to Word Application

.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (No Ratings Yet)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.