title image


Smiley Re: Datenbank in einzelne Datensätze zerlegen???
Das geht z.B. so:Dim Tmp, WordObj As Word.Application, I As Long, FN As StringDim RS As Recordset, DB As Database On Error Resume Next Debug.Print CurDir Set DB = CurrentDb Set RS = DB.OpenRecordset("MeineTabelle", dbOpenDynaset) Set WordObj = GetObject(, "Word.Application ") If Err.Number 0 Then Set WordObj = CreateObject("Word.Application") On Error GoTo 0 With WordObj I = 0 .Application.Visible = True Do While Not RS.EOF I = I + 1 .Documents.Add Tmp = "Herrn " & RS!Vorname & " " & RS!Nachname & _ vbCrLf & RS!Strasse & vbCrLf & RS!PLZ & " " & RS!Ort .Selection.TypeText Text:=Tmp FN = "WordDoc" & Format(I, "0000") .ActiveDocument.SaveAs FileName:="""" & FN & """", FileFormat:=wdFormatDocument .ActiveDocument.Close RS.MoveNext Loop .Application.Quit End With Set WordObj = NothingReinhard


Gruß aus dem Norden
Reinhard


Bitte immer die Access-Version angeben!
DB-Wiki


Wie man Fragen richtig stellt

YaccessAccess-FAQUnd ansonsten: Wikipedia




geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: