"If" statements in Word 2003

M

m2work

Hello,

I am working in a company that has mutliple branches. I would like to use 1
form for all the branches. I have set up just the name of the branch at the
bottom of the page with checkboxes. What I would like to do is - if they
check on any given box, the information for that specific branch will display
underneath the company logo. Is there a way to do this instead of listing 15
addresses, tel nos and fax nos at the bottom of the page?

Any help is greatly appreciated.

Thanks,
m2
 
B

bryan

What I would do is create a userform with a combobox with your Branch
selections.
Upon selecting a Branch I would include the appropriate auototext entry into
a bookmark on the bottom of your form.

Bryan
 
M

m2work

Hi Bryan,

Thanks for the info.

Unfortunately, I have never done anything with userform and combobox. Can a
tutorial be found online somewhere?

Thanks again,
m2
 
B

bryan

heres a tutorial on userforms:
http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm

in your template doc(new)
Set UF = New UserForm1
UF.Show
strrec = UF.ComboBox1.Text
Set UF = Nothing

'strrec is value selected from combobox
Dim bmRange As Range
Set bmRange = ActiveDocument.Bookmarks("myBookmark").Range

'''Insert AutoText

ActiveDocument.AttachedTemplate.AutoTextEntries(strrec).Insert
Where:=bmRange, RichText:=True
ActiveDocument.Bookmarks.Add _
Name:="myBookmark", _
Range:=bmRange

your code needed for userform:

Sub UserForm_Initialize()
ComboBox1.AddItem ("Banch Name1")
ComboBox1.AddItem ("Branch Name2")
ComboBox1.AddItem ("etc")
ComboBox1.ListIndex = 0
End Sub
Sub CommandButton1_Click()
Me.Hide
End Sub


This should get you going.

Bryan
 
M

m2work

Many thanks for your help. I will try to put these codes into a userform.

Thanks,
m2
 

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