Solved

Automated Word 2003 Forms using VBA

Posted on 2011-03-09
3
260 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
ID: 35084439
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
ID: 35089510
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
ID: 35092894
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

919 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

23 Experts available now in Live!

Get 1:1 Help Now