PDA

View Full Version : Using old (legacy) controls with Word 2007



Maverick777
08-03-2009, 02:24 AM
Hi,
I've a Word template with various types of form fields in it, and it worked fine with my previous Offcie version. Since we've upgraded to Office 2007, I'm having few problems with using the drop down control.

Firstly, I'm unable to select an item from the drop down list. When I click on it, properties window opens up, where I can add or delete items to the list. But, I still couldn' find a way to select an item from that list.

Secondly, to avoid the above problem, I thought of adding a drop down box from the new set of tools. That works fine, untill it hits my VBA code. I don't have the new field in the form fields collection. Below is the piece of code that fails. Error message is "The requested member of the collection does not exist."

ActiveDocument.FormFields("Categorisation").Result = Categorisation.Value

Any help on this is greatly appreciated, as I've already spent great deal of time with this one.

Thanks

macropod
08-03-2009, 04:03 PM
Hi Maverick,

You can only access a formfield's properties while the document is unprotected, at which time you can also add/delete dropdown items. But, until the document is protected for forms, you can't get the dropdown to 'work'.

Your problem description suggests you haven't protected the document.

Maverick777
08-04-2009, 07:36 AM
Hi macropod,
Thanks for your reply. My document is not protected at the moment, so that can be the problem. But, how do I protect it, which option should I take. Is it "Restrict Formating and Editing" or "Restricted Access" option under protect document option.
When I do "Restrict Formating and Editing", I cannot see any improvement. When I do "Restricted Access" option, it wants and Windows live email address to enable Read and Change permissions, and I entered mine. Still no improvements though. There's an information bar on top saying restricted access, but still "Protect Docuement" button is available (unlike in Excel where it changes to Unprotect Worksheet when the worksheet is protected). I still cannot open the drop down box and select and item from it.

Any idea on why the new drop down box not available in ActiveDocument.FormFields collection. Its a standard, but new style, drop down box.

macropod
08-04-2009, 05:58 PM
Hi Maverick,

How about 'Editing Restrictions> Filling in forms'!

As for your other problem, I doubt it has anything to do with the formfields collection. Are you sure the formfield's bookmark name is 'Categorisation'? Alternatively, perhaps the error relates to whatever 'Categorisation.Value' is. As a test, try:
ActiveDocument.FormFields("Categorisation").Result = "G"
That works for me in both Office 2000 and 2007.

Maverick777
08-05-2009, 11:06 AM
Hi macropod,
Thank you so much, you are a star. "Filling in forms" under "Editing restrictions" worked for me and now I can select from the drop down box.
Still, ActiveDocument.FormFields("Categorisation").Result = "G" doesn't work. It cannot find the Categorisation field in the FormFields collection. It doesn't bother me much now, but its good to know why that is.

Cheers