Assign Insert file command to tick box in userform

J

JenDNeedsHelp

I'm currently using Word 97 on Windows NT 4 Service Pack 6A. I'm trying to
create a multi-page userform to allow me to tick a number of boxes. The idea
would be that each tickbox represents a file which, if the box is ticked,
would insert that file at the appropriate bookmark. Ideally, I would like to
be able to tick a number of boxes, on each page of the form, and have the
macro go off and get each one and insert it, presenting me with the finished
document. While I'm a very confident Word user, this is my first attempt at
VBA Editor and I'm hopelessly lost. Help here would be very, very much
appreciated.

Regards

Jen
 
D

Doug Robbins

Use the following construction:

With ActiveDocument
If CheckBox1.Value = True Then
.Bookmarks("test").Range.InsertFile ("[Drive]:\[path]\[filename]")
End If
End With

To give your users the opportunity to change their mind over which files are
to be inserted (= check boxes ticked), I would have a command button that
runs this code, rather than have it run by the checkbox click event.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top