PDA

View Full Version : Solved: Form Question



Saxylady1964
03-04-2009, 11:26 AM
I've used VBA in Excel, but this is my first attempt at Word.

I have a document with a number of form fields. I'd like to create a macro that will verify that information has been entered in each field. i.e. all the checkboxes have been checked, text fields have text etc.

This is what I have. I'm using "" to indicate an empty field, but apparently the field does not = "".

If Bookmarks("text1").Range = "" Then MsgBox "Please Enter Text"


Can anyone help me? Thanks in advance :)

Diana

fumei
03-04-2009, 11:35 AM
When using formfields it is better to use FormFields, rather than Bookmarks.

Formfields have bookmarks, but they can also not have bookmarks. They are NOT the same.

So...

If ActiveDocument.Formfields("name").Result = "" Then

Saxylady1964
03-04-2009, 12:41 PM
Thanks fumei :)

Saxylady1964
03-04-2009, 03:31 PM
Now that I have that problem fixed, I have a new one. The form that I am working on has a number of hyperlinks which open Powerpoint Presentations (pps). When I protect the document for use as a form, I can no longer use the hyperlinks. Any Suggestions?

fumei
03-05-2009, 12:05 PM
Nope. Hyperlinks do not work when the document is protected for forms.

Depending on exactly what you are trying to do, you could possibly use VBA to do the Powerpoint opening. Hard to say as I do not know what your exact requirements are.

lucas
03-05-2009, 04:40 PM
Diana, can we keep the questions about the hyperlinks in the other thread to avoid confusion?

http://www.vbaexpress.com/forum/showthread.php?t=25490

I will respond to your question there.