P
Pete
Hi - An earlier posting discussed this same result but I do not think I
have the same coding problems. In the following VB6 program the
"InsertBefore" works but then VS crashes when it tries to process the
first "Find" line. Help would sure be appreciated!
Dim wdApp As Word.Application
Dim wdDocs As Word.Documents
Dim wdDoc As Word.Document
Dim wdSel As Word.Selection
Set wdApp = New Word.Application
Set wdDocs = wdApp.Documents
Set wdDoc = wdApp.Documents.Add
wdDoc.Activate
wdDoc.Content.Text = "aba"
wdDoc.Content.Select
Set wdSel = wdApp.Selection
wdSel.InsertBefore "d"
wdApp.Visible = True
' either of the next two, by itself, crashes VS
wdSel.Find.ClearFormatting
wdSel.Find.Text = "b"
wdSel.Find.Execute
...
- Pete
have the same coding problems. In the following VB6 program the
"InsertBefore" works but then VS crashes when it tries to process the
first "Find" line. Help would sure be appreciated!
Dim wdApp As Word.Application
Dim wdDocs As Word.Documents
Dim wdDoc As Word.Document
Dim wdSel As Word.Selection
Set wdApp = New Word.Application
Set wdDocs = wdApp.Documents
Set wdDoc = wdApp.Documents.Add
wdDoc.Activate
wdDoc.Content.Text = "aba"
wdDoc.Content.Select
Set wdSel = wdApp.Selection
wdSel.InsertBefore "d"
wdApp.Visible = True
' either of the next two, by itself, crashes VS
wdSel.Find.ClearFormatting
wdSel.Find.Text = "b"
wdSel.Find.Execute
...
- Pete