|
-
Jun 27th, 2006, 09:29 AM
#1
Thread Starter
New Member
Form automation in Word 2003
Hi, I am trying to automate my first form to print client labels for sticking on forms. I want to enter the details for one sticker and get the form to fill out the remainder of the stickers/labels on the page automatically.
Obviously there is a problem with the form or macro working to populate the fields.
If anyone can tell me how to get this working I would really appreciate it?
I have this code on the command button 1, it lets me put the information into the fields of the form but errors when I click on the button.
Private Sub CommandButton1_Click()
With ActiveDocument
.Field("Surname").range_
.InsertBefore Surname
.Field("GivenNames").range_
.InsertBefore GivenNames
.Field("DOB").range_
.InsertBefore DOB
.Field("Doctor").range_
.InsertBefore Doctor
.Field("Allergies").range_
.InsertBefore Allergies
UserForm1.Hide
End Sub
The fields on my Word document have the same names (I previously had "Bookmarks" in this code where I now have fields but that didn't work either.
In the macro (autonew) I have the code
Sub autonew()
'
' autonew Macro
' Macro created 6/27/2006 by Syd
'
UserForm1.Show
End Sub
Thankyou for any help anyone can give me
Syd Farrell
-
Jun 28th, 2006, 05:37 AM
#2
Re: Form automation in Word 2003
can i ask why you don't use mailmerge for mailing labels?
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|