Stormrider83
Computer Science Student
- Local time
- Today, 16:38
- Joined
- Jul 16, 2008
- Messages
- 26
Hi!
This will have a simple solution (hopefully).
I have a word document with bookmarks and VBA code to export records and place them within the bookmarks:
The only problem is only the first record is placed in the document.
1) How do I place all records in the document?
2) How do I place all records in the document until page is full. ie if I have 10 records and 80 places how do I repeat the documents until the places are full.
To put it in context I am printing address labels but would like pages of them rather than 10 address labels and lots of blank stickers!
This will have a simple solution (hopefully).
I have a word document with bookmarks and VBA code to export records and place them within the bookmarks:
Code:
Private Sub Labels_Click()
Dim MyWord As Word.Application
Dim PathDocu As String
Set MyWord = New Word.Application
PathDocu = "L:\Factory Database\"
With MyWord
.Documents.Open (PathDocu & "L4731.doc")
.ActiveDocument.Bookmarks("Description").Range.Text = Me.Description
.ActiveDocument.Bookmarks("Part_No").Range.Text = Me.Part_No
.ActiveDocument.Bookmarks("Qty").Range.Text = Me.Part_Qty
.Visible = True
End With
DoEvents
Set MyWord = Nothing
End Sub
The only problem is only the first record is placed in the document.
1) How do I place all records in the document?
2) How do I place all records in the document until page is full. ie if I have 10 records and 80 places how do I repeat the documents until the places are full.
To put it in context I am printing address labels but would like pages of them rather than 10 address labels and lots of blank stickers!