View Single Post
 
Old 02-01-2018, 11:44 AM
ksor ksor is offline Windows 10 Office 2016
Advanced Beginner
 
Join Date: Feb 2018
Location: Århus V, Denmark
Posts: 74
ksor is on a distinguished road
Default Placing text and pictures in Word-document ??

Placing text and pictures in a WORD document.

Code:
Public Sub getBilleder(f As Form, bD As Word.Document)
    Dim tbl As DAO.Recordset
    Set tbl = CurrentDb.OpenRecordset("SELECT BILLEDE.*, BILLEDE.PersonID, BILLEDE.Sortering " & _
                                      "FROM BILLEDE WHERE (((BILLEDE.PersonID)=" & Me.PersonID & _
                                      ")) ORDER BY BILLEDE.Sortering;", dbOpenDynaset)
    With tbl
        .MoveFirst
        If .NoMatch Then Exit Sub
        bD.Content.InsertAfter ("Registrerede billeder: " & CrLf(2))
        Do
            bD.Content.InsertAfter (.Fields("Billedtekst") & CrLf(1))
            bD.Shapes.AddPicture (TrimFrom("Right", CurrentDb.Name, "\") & "IMG_files\" & .Fields("Sti til fil"))
           .MoveNext
        Loop Until .EOF
    End With
    Set tbl = Nothing
End Sub
but the text AND the pictures are places on top of earch other.

How can I arrange the text and pictures something like this:

Overall headline "Registrerede billeder: " & CrLf(2)

Text for first picture: .Fields("Billedtekst") < a frame with the picture - the biggest thimbnail>

Text for the second picture: .Fields("Billedtekst") < a frame with the picture - the biggest thimbnail>

and so on for all pictures in the recordset
Reply With Quote