Using Bookmarks in automation

L

Laurie

I have the following code:
Function GOTOword()
Dim otable As Word.Table
Set objword = New Word.Application
objword.Visible = True
Set odoc = objword.Documents.Add

Set otable = odoc.Tables.Add(odoc.Bookmarks
("\endofdoc").Range, 6, 6)

otable.Cell(1, 1).Range.Text = Reports!
reportMondayGeneralamwithstaff

End Function

If I substitute "hi" for the reports!
reportMondayGeneralAMwithStaff, the word hi appears in the
table as I want it to. But, with the report in there, I
get a type mismatch. So, how should I be referring to the
report to get out of the type mismatch?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top