Click here to Skip to main content
15,922,512 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: whether Math class contain function Pin
Christian Graus14-Aug-08 0:23
protectorChristian Graus14-Aug-08 0:23 
AnswerRe: whether Math class contain function Pin
Thomas Stockwell14-Aug-08 2:13
professionalThomas Stockwell14-Aug-08 2:13 
AnswerRe: whether Math class contain function Pin
Guffa14-Aug-08 21:17
Guffa14-Aug-08 21:17 
QuestionOptimize memory speed,CPU speed and Disk speed using Vb.net Pin
pavanip13-Aug-08 23:37
pavanip13-Aug-08 23:37 
AnswerRe: Optimize memory speed,CPU speed and Disk speed using Vb.net Pin
Colin Angus Mackay13-Aug-08 23:51
Colin Angus Mackay13-Aug-08 23:51 
AnswerRe: Optimize memory speed,CPU speed and Disk speed using Vb.net Pin
Christian Graus14-Aug-08 0:22
protectorChristian Graus14-Aug-08 0:22 
QuestionFind Firefox browsing history,Auto complete data list Pin
pavanip13-Aug-08 23:09
pavanip13-Aug-08 23:09 
Questionparse word document line by line Pin
Member 265755313-Aug-08 22:19
Member 265755313-Aug-08 22:19 
I have a word file and I wish to extract certain information from it. For example, i wish to extract the filds called info of interest:
using vb.net or c#.net



News: Info of interest

Title: Info of interest

DAte: Info of interest>

Subject: info of interest



I want to be able to:



-Open doc file

-Read first line

- extract the <info of="" interest=""> .

-Go to next line & repeat process until end of file.



Can anyone help please????



Thanks

REjith

code

Imports System.IO.File
Imports sqld
Public Class Form1

Private ob1 As sqld.sqld.sqldb
Public Sub New()

' This call is required by the Windows Form Designer.
InitializeComponent()
ob1 = New sqld.sqld.sqldb()
' Add any initialization after the InitializeComponent() call.

End Sub
Private WordApp As New Word.ApplicationClass()

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
OpenFileDialog1.Filter = "Word Documents|*.doc"
txtFileName.Text = OpenFileDialog1.FileName
OpenFileDialog1.ShowDialog()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim WordApp As New Word.ApplicationClass()

Dim file As Object = OpenFileDialog1.FileName
'Dim wdLineType1 As Word.WdLineType = Word.WdLineType.wdTextLine

Dim nullobj As Object = System.Reflection.Missing.Value

Dim doc As Word.Document = WordApp.Documents.Open(file, nullobj, nullobj, nullobj, nullobj, nullobj, _
nullobj, nullobj, nullobj, nullobj, nullobj, nullobj, _
nullobj, nullobj, nullobj)
doc.Activate()
'Dim st As System.Type
'st = wdLineType1.GetType
'Dim doc1 As Word.Document = WordApp.ActiveDocument


Label2.Text = doc.Range(0, 9).Text

' Label2.Text += " " + doc.'wdLineType1.GetValues(st).GetValue(1).ToString
'Dim m_Content As String = doc1.Content.Text
'Label2.Text = m_Content

'doc.ActiveWindow.Selection.WholeStory()
'doc.ActiveWindow.Selection.Copy()

'Dim data As IDataObject = Clipboard.GetDataObject()

''Do whatever with the text.
'Label2.Text = data.GetData(DataFormats.StringFormat)





'Close doc and shutdown Word application.
doc.Close(nullobj, nullobj, nullobj)
WordApp.Quit(nullobj, nullobj, nullobj)
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim temp As String = Label2.Text.ToString()
Dim ch As Char() = {":"}
Dim str1 As String() = Label2.Text.Split(ch)
Try
For i As Integer = 0 To str1.GetUpperBound(0)
'MessageBox.Show(str1(3).ToString())


'Dim str22 As String = ob1.insertNData(str1(1), str1(3), str1(5), str1(7)).ToString()


i = i + 1
Next
Catch ie As IndexOutOfRangeException
ie.ToString()
End Try
End Sub
End Class

please help
AnswerRe: parse word document line by line Pin
Thomas Stockwell14-Aug-08 2:15
professionalThomas Stockwell14-Aug-08 2:15 
QuestionRead word document line by line using vb.net Pin
Member 265755313-Aug-08 21:35
Member 265755313-Aug-08 21:35 
QuestionData not get saved if using Shortcut key instead of clikng button Pin
honeyashu13-Aug-08 21:01
honeyashu13-Aug-08 21:01 
AnswerRe: Data not get saved if using Shortcut key instead of clikng button Pin
Christian Graus13-Aug-08 21:16
protectorChristian Graus13-Aug-08 21:16 
GeneralRe: Data not get saved if using Shortcut key instead of clikng button Pin
honeyashu13-Aug-08 21:26
honeyashu13-Aug-08 21:26 
GeneralRe: Data not get saved if using Shortcut key instead of clikng button Pin
Christian Graus13-Aug-08 22:50
protectorChristian Graus13-Aug-08 22:50 
GeneralRe: Data not get saved if using Shortcut key instead of clikng button Pin
honeyashu13-Aug-08 23:23
honeyashu13-Aug-08 23:23 
GeneralRe: Data not get saved if using Shortcut key instead of clikng button Pin
Christian Graus13-Aug-08 23:35
protectorChristian Graus13-Aug-08 23:35 
GeneralRe: Data not get saved if using Shortcut key instead of clikng button Pin
honeyashu14-Aug-08 0:25
honeyashu14-Aug-08 0:25 
QuestionError while invoking the delegate Pin
Nilish13-Aug-08 17:50
Nilish13-Aug-08 17:50 
AnswerRe: Error while invoking the delegate Pin
Christian Graus13-Aug-08 18:10
protectorChristian Graus13-Aug-08 18:10 
GeneralRe: Error while invoking the delegate Pin
Mark Churchill13-Aug-08 23:42
Mark Churchill13-Aug-08 23:42 
GeneralRe: Error while invoking the delegate Pin
Gideon Engelberth14-Aug-08 2:44
Gideon Engelberth14-Aug-08 2:44 
AnswerRe: Error while invoking the delegate Pin
Gideon Engelberth14-Aug-08 2:48
Gideon Engelberth14-Aug-08 2:48 
QuestionClass theory, what am I missing Pin
Justin Porteous13-Aug-08 10:22
Justin Porteous13-Aug-08 10:22 
AnswerRe: Class theory, what am I missing Pin
nlarson1113-Aug-08 10:42
nlarson1113-Aug-08 10:42 
GeneralRe: Class theory, what am I missing Pin
Justin Porteous13-Aug-08 20:41
Justin Porteous13-Aug-08 20:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.