Solved

Automated Word 2003 Forms using VBA

Posted on 2011-03-09
3
258 Views
Last Modified: 2012-05-11
I'm new to Word Forms so I'm testing out a Word 2003 Form with a few checboxes on it (bkCheck1; bkCheck2, bkCheck2). I've put a Macro on the form that triggers on exit from bkCheck1. The Macro is below and is just a test, so I've made it as simple as I could but it doesn't work. I've locked the form before testing, made sure the MS Office Word 11 Object library has been loaded, enabled Macros and checked the Macro is hooked onto the document. Nothing

Sub Macro1()
ActiveDocument.Bookmarks("bkCheck3").Select
MsgBox ("Check1 checked")
End Sub
0
Comment
Question by:JP53
3 Comments
 
LVL 10

Accepted Solution

by:
borgunit earned 500 total points
Comment Utility
What you are showing is not a reference to a form object (check box). You are selecting a bookmark named "bkCheck3" being selected and then popping up a msgbox.

I would have expected something like:

If SomeForm.bkCheck3.value = 1 then
   MsgBox ("Check1 checked")
End if
0
 
LVL 76

Expert Comment

by:GrahamSkan
Comment Utility
If your macro does not show a message, then it isn't running at all.

The first line should either give an error message and/or carry on to produce the programmed message : - "Check1 checked"

What mechanism are you using to start the macro code?
0
 

Author Comment

by:JP53
Comment Utility
Hi GrahamSkan,

Already sorted. It seems that the on exit field method reacts in weird ways with Word Forms.

Thanks anyway for the input
J
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
I would like to show you some basics you can do with Mailings in MS Word. It´s quite handy feature you can use for creating envelopes, labels, personalized letters etc. First question could be what is this feature good for? Mailing can really he…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now