hallo kan iemand me zeggen waarom met deze code het document in word niet geopend word?
Dim wordApp As New Word.Application
Dim doc As New Word.Document
Dim x As Integer
doc = wordApp.Documents.Add("f:\test.doc")
Doc.Activate()
'doc.Bookmarks.Item("Test").Select()
doc.Bookmarks.Item("Onderwerpen").Range.Text = OnderwerpenTextBox.Text
doc.Bookmarks.Item("Voorstellen").Range.Text = VoorstellenTextBox.Text
'For x = 0 To TvergaderingaanwezigenBindingSource.Count - 1
' doc.ActiveWindow.Selection.TypeText(Text:=Me.Databank_voor_eindwerkDataSet.Tables("Tvergaderingaanwezigen").Rows(x).Item("Vergaderingid"))
' doc.ActiveWindow.Selection.MoveRight(Word.WdUnits.wdCell)
' doc.ActiveWindow.Selection.TypeText(Text:=Me.Databank_voor_eindwerkDataSet2.Tables("Tvergaderingaanwezigen").Rows(x).Item("nummer"))
' If x <> TvergaderingaanwezigenBindingSource.Count - 1 Then
' doc.ActiveWindow.Selection.MoveRight(Word.WdUnits.wdCell)
' End If
'Next
' doc.PrintPreview()
CType(doc, Word.Document).Close(False)
'CType(wordApp, Word.Application).Quit()
End Sub
Dim wordApp As New Word.Application
Dim doc As New Word.Document
Dim x As Integer
doc = wordApp.Documents.Add("f:\test.doc")
Doc.Activate()
'doc.Bookmarks.Item("Test").Select()
doc.Bookmarks.Item("Onderwerpen").Range.Text = OnderwerpenTextBox.Text
doc.Bookmarks.Item("Voorstellen").Range.Text = VoorstellenTextBox.Text
'For x = 0 To TvergaderingaanwezigenBindingSource.Count - 1
' doc.ActiveWindow.Selection.TypeText(Text:=Me.Databank_voor_eindwerkDataSet.Tables("Tvergaderingaanwezigen").Rows(x).Item("Vergaderingid"))
' doc.ActiveWindow.Selection.MoveRight(Word.WdUnits.wdCell)
' doc.ActiveWindow.Selection.TypeText(Text:=Me.Databank_voor_eindwerkDataSet2.Tables("Tvergaderingaanwezigen").Rows(x).Item("nummer"))
' If x <> TvergaderingaanwezigenBindingSource.Count - 1 Then
' doc.ActiveWindow.Selection.MoveRight(Word.WdUnits.wdCell)
' End If
'Next
' doc.PrintPreview()
CType(doc, Word.Document).Close(False)
'CType(wordApp, Word.Application).Quit()
End Sub