Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Automated Word 2003 Forms using VBA

Posted on 2011-03-09
3
Medium Priority
?
272 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Accepted Solution

by:
borgunit earned 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This video walks the viewer through the process of creating an MLA formatted document, as well as a bibliography with citations.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Suggested Courses

610 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