[RESOLVED] bookmarks and Tables
Hello,
I'm developing a template thats updated every financial year, it contains the same year date in it about a 100 times "2008/09" depending on which year its about. I've managed to automate it via a VBA form but the sheer number of bookmarks makes it a up hill task,
Quote:
Originally Posted by
koolsid
Something like this?
Code:
Private Sub cmd_ok_Click()
Dim I As Long, J As Long, K As Long
For I = 1 To 7
'Entering financial year date into Heading 1
ActiveDocument.Bookmarks("TitleDate" & I).Select
Selection.Text = (frmendyear.txtdate.Text)
DoEvents
Next I
For J = 1 To 4
'Entering financial year date into standard text
ActiveDocument.Bookmarks("textdate" & J).Select
Selection.Text = (frmendyear.txtdate.Text)
DoEvents
Next J
For K = 1 To 4
'Entering in 'To' Financial date
ActiveDocument.Bookmarks("todate" & K).Select
Selection.Text = (frmendyear.txtto.Text)
DoEvents
Next K
End Sub
Many thanks to Koolsid, the above code works really well, although I've had to put in a few tables into my document, and I added in the extra code, but alas I get a "runtime error '424' Object required". it gets hung up on the "Selection.Text = (frmenedyear.txtdate.Text)"
An help would be greatly appriciated.