I'm trying to open an existing Word document and update some bookmarks with the text from several textboxes on my form. I found the code below from a google search, but I can't get VWD to accept it. I've added a reference to Word 11.0 in the Solution Explorer and I've added the import statement below, but still nothing. Obviously, I'm missing something yet I can't find anything that clues me to what that something is. The stuff underlined has the blue squiggly line under them and a tooltip that says either "Type 'xxx' is not defined", or "Name 'xxx' is not declared". Does anyone have an idea? This the last hurdle to overcome to get my application working completely. BTW, I'm using
VB.
Imports Microsoft.Office.Interop.Word
Dim wdApp As New [u]Word.Application</u>
'-- with the keyword "New" you don't need the next line
wdApp = CreateObject("Word.Application")
Dim owdDoc As [u]Word.Document</u>
[u]wdDoc</u> = wdApp.Documents.Open("(actual path omitted\TSPrint.doc")
wdApp.visible = True
With [u]wdDoc</u>.Bookmarks
.Item("EFF").Range.Text = rdoEFF.SelectedItem.Value
.Item("ATACHAP").Range.Text = txtChapter.Text
.Item("ATASECT").Range.Text = txtSection.Text
.Item("CAS").Range.Text = txtCAS.Text
.Item("FAULT").Range.Text = txtFault.Text
.Item("CAUSE").Range.Text = txtCause.Text
.Item("STEP").Range.Text = txtSteps.Text
End With
[u]wdDoc</u> = Nothing
wdApp = Nothing