-
Een bookmark in een footnote
Posted on March 22nd, 2010 No commentsIn office word is het eenvoudig om bookmarks te plaatsen en die vervolgens dmv VBA van de nodige tekst uit bijvoorbeeld een database te voorzien.
Dit kan in VBA dmv
Dim apWord As New Word.Application
With apWord
With .Selection
.Goto wdGoToBookmark, Name:="MijnBookmarkNaam1"
.TypeText rsTabel!Veldnaam
End WithEnd With
set apWord = nothing
Maar wat als je een bookmark in een footnote dient te voorzien van dynamische data?
We werken het eerste voorbeeld verder uit:
Dim apWord As New Word.Application
With apWord
With .Selection
.Goto wdGoToBookmark, Name:="MijnBookmarkNaam1"
.TypeText rsTabel!Veldnaam
End With
.ActiveWindow.View.SeekView = wdSeekFootnotes
.Goto wdGoToBookmark, Name:="MijnBookmarkInEenFootnoteNaam1"
.TypeText rsTabel!voetnoottekst
End With
set apWord = nothing



Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.