Software solutions and questions blog
RSS icon Email icon Home icon
  • Een bookmark in een footnote

    Posted on March 22nd, 2010 Christophe No comments

    In 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 With

    End 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