Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2006

Tip: Looking for answers? Try searching our database.

Parsing Word 2003 XML : Drop-Down Form Field Value

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Wayne Feraera - 10 Apr 2006 08:17 GMT
I've also had the problem of trying to get dropdown or checkbox data out of
WordML.  Below is what a small Drop-Down Form Field looks like in WordML.  
I've tried to base64-decode the fldData put with no joy.

Can you help?

Thanks.

<aml:annotation aml:id="0" w:type="Word.Bookmark.Start" w:name="Dropdown1"/>
<w:p>
 <w:r>
   <w:fldChar w:fldCharType="begin">    
<w:fldData>/////2aAAAAAAAkARAByAG8AcABkAG8AdwBuADEAAAAAAAAAAAAAAAAAAAAAAAAA­AAAAAAAA//8D
AAAABQBhAGwAcABoAGEABABiAGUAdABhAAcAYwBoAGEAcgBsAGkAZQA=
     </w:fldData>
   </w:fldChar>
 </w:r>
 <w:r>
   <w:instrText> FORMDROPDOWN </w:instrText>
 </w:r>
 <w:r>
   <w:fldChar w:fldCharType="end"/>
 </w:r>
<aml:annotation aml:id="0" w:type="Word.Bookmark.End"/>
</w:p>
Cindy M  -WordMVP- - 11 Apr 2006 11:03 GMT
Hi =?Utf-8?B?V2F5bmUgRmVyYWVyYQ==?=,

> I've also had the problem of trying to get dropdown or checkbox data out of
> WordML.  Below is what a small Drop-Down Form Field looks like in WordML.  
> I've tried to base64-decode the fldData put with no joy.

No, it's in a proprietary, binary format. I've had discussion about this in
the office.developer newsgroups (you can search Google) and we've reached the
following conclusions

1. You cannot get the information from a dropdown field. Best you can do is
include code in your form that will write the dropdown field selection to
something else, such as a document property, document variable or a (hidden)
textbox form field

2. You can sorta get the information from a checkbox. The checked vs. the
unchecked states *in the same context* are always the same XML. By "same
context" I mean position in relation to other things. Things I've found that
affect the XML code of a checkbox:
   - is it the default name, or have you named it
   - is it alone in a table cell
   - have you selected and bookmarked it

As long as you "know" the document - or better, have set it up - you can
reliably extract the checkbox information.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
Wayne Feraera - 11 Apr 2006 12:47 GMT
> Hi =?Utf-8?B?V2F5bmUgRmVyYWVyYQ==?=,
>
[quoted text clipped - 29 lines]
> This reply is posted in the Newsgroup; please post any follow question or
> reply in the newsgroup and not by e-mail :-)

Hi,

Thanks for the reply.
I have a dropdown list called "Title" with 3 values (Mr. Miss. Mrs.)

You have written "You cannot get the information from a dropdown field".
As per your suggestion, I have placed a bookmark next to dropdown field(
will hide it later once it works), whose value is updated upon selecting
different values of Dropdown list. (New value selected is Miss)

Now I have read the value in this new hidden bookmark and have written it to
Database. That is also fine.

My Query is, "HOW CAN I SET THE INFORMATION TO DROP DOWN LIST". (i.e.
previously selected value i.e. MISS).  

Whole of last week I was actually going through your articles only,
fortunately this is attended by you. Thanks.
Cindy M  -WordMVP- - 11 Apr 2006 15:42 GMT
Hi =?Utf-8?B?V2F5bmUgRmVyYWVyYQ==?=,

> My Query is, "HOW CAN I SET THE INFORMATION TO DROP DOWN LIST". (i.e.
> previously selected value i.e. MISS).

Using XML respectively a transform? You cannot.

If you have macro code in the document, then an AutoOpen macro should be
able to do this. Roughly:

   ActiveDocument.Formfields("XYZ").Result =
ActiveDocument.Bookmarks("Name").Range.Text

(Note: using this technique you can even add values to the list! So be
careful.)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.