I should add this code is being developed in vb.net for a stand alone windows
application.
> Hello All,
>
[quoted text clipped - 11 lines]
>
> Thanks!
The following code worked for moving the replacing the token, moving the
cursor and using a dataset.table value for inserting the text as opposed to
attempting to assign the value to a string
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim app As New Microsoft.Office.Interop.Word.Application
Dim doc As Microsoft.Office.Interop.Word.Document =
app.Documents.Add("test7")
Dim para1 As Microsoft.Office.Interop.Word.Paragraph
Dim docString As String
Dim count As Integer
Dim test As Boolean
cmdcommand.Connection = GetConnection()
cmdcommand.CommandText = "SELECT
field_eis_purpose_value,field_eis_agenda_value,field_eis_notes_value,field_eis_requirements_value," & _
"field_eis_action_items_value,field_eis_open_issues_value,field_eis_meeting_date_value,field_eis_attendees_value " & _
"FROM content_type_eis_meeting_notes meeting " & _
"INNER JOIN (select max(vid) as vid from
content_type_eis_meeting_notes group by nid) m2 ON " & _
"m2.vid = meeting.vid LEFT OUTER JOIN content_field_eis_notes note
on " & _
"note.vid = meeting.vid LEFT OUTER JOIN
content_field_eis_open_issues issue ON " & _
"note.vid = issue.vid WHERE meeting.nid = 681"
daDataAdapter.SelectCommand = cmdcommand
'Populate temp dataset
daDataAdapter.Fill(dsDataSetFinal)
count = 0
test = True
Do While test
ReplaceText(app, count)
app.Selection.Text = dsDataSetFinal.Tables(0).Rows(0)(count)
count += 1
test = doc.Content.Find.Execute(findtext:="{Text}")
Loop
doc.SaveAs("Test123")
app.Visible = True
End Sub
Public Function ReplaceText(ByRef app As
Microsoft.Office.Interop.Word.Application, ByVal i As Integer)
With app.Selection.Find
.Execute(findtext:="{Text}", _
ReplaceWith:="")
.Forward = True
.Wrap = Microsoft.Office.Interop.Word.WdFindWrap.wdFindContinue
End With
End Function
> Hello All,
>
[quoted text clipped - 11 lines]
>
> Thanks!