Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exceldata to Word bookmarks

Status
Not open for further replies.

kalle82

Technical User
Apr 2, 2009
163
SE
Hi!

I have started to create a sub which should populate bookmarks in a word template.. Seemed pretty damn easy.. But nono.. It's harder than i thought..

It just throws me a runtime error 424 "object needed"?
Why is that.. I have double checked and can confirm that there is a bookmarknamed content.
Code:
Dim wrdapp As Word.Application
Dim wrddoc As Word.Document

Set wrdapp = CreateObject("word.Application")

wrdapp.Visible = True

Set wrddoc = wrdapp.Documents.Add("C:\Documents and Settings\QUJF\Skrivbord\Superhandläggning\mallv2.dot")

wrddoc.Bookmarks("content").Range.Text = TextBox12.Text
 
What is TextBox12 ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Yes, TextBox12 has to be qualified. And why are you opening a .DOT file as a document?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top