Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Transfer of the data from microsoft word to Access
Author:
vikas vyas
E-mail:
Click to e-mail author
Submitted:
9/6/2005
Version:
VB.NET 2003
Compatibility:
VB.NET 2003
Category:
Miscellaneous
Views:
20702
How to transfer data from Ms-Word to Access.
Declarations:
'none
Code:
module module1 Public ObjConn As OleDb.OleDbConnection = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Users-1\My Documents\db2.mdb") Public Dset As New DataSet() Public Sub OpenConn(ByVal strsql As String) Dim Dadapter As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(strsql, ObjConn) Dadapter.Fill(Dset) End Sub end module 'put it into the form_load event Dim wordapp As New Word.Application() 'open the existing word documnet wordapp.Documents.Open("D:\v1.doc") Try Dim para As Word.Paragraph For Each para In wordapp.ActiveDocument.Paragraphs TextBox1.Text = para.Range.Text Next OpenConn("insert into datatransfer values( '" & TextBox1.Text & "')") Catch ex As System.Exception MessageBox.Show(ex.Message) End Try
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement