March 28, 20169 yr First of all, I'm not sure that "placeholder text" is the correct term for the MS Word object. I'm working with multiple MS Word documents from the state government. The content is locked but there seems to be placeholder text that I can tab through. The placeholder text is highlighted in gray and marked with an asterisk before and after the text (see image). I'm experiencing a couple of issues: 1. If I choose the text inside the asterisk, then the substitution works but it leaves the asterisks (see #1 in Scribe_New_doc). 2. When I choose "Amount", inside the asterisks, a NULL value is returned. I thought perhaps it would not accept numbers so I created a text field with the same value. However, this also returns a NULL value (see #2 in Scribe_New_doc). 3. If I choose all of the text, including the asterisks, then the substitution value is NULL (see #3 in Scribe_New_doc).
March 28, 20169 yr ScribeDocSubstitute replaces text with text, not named placeholders with text. This is expected functionality. On a locked document like the one you are using it wouldn't work. For named placeholders you want to use ScribeDocWriteValue. I would recommend using ScribeDocListFields to identify the proper names of your controls fields (the named placeholders).
March 28, 20169 yr Author Thanks Caleb. I used the Example Script from the "How to use Scribe" file in order to get the list of fields, as you recommend (see attached). I used the ScribeDocListFields in a local variable but it doesn't appear to return anything. I'm not sure what I'm doing wrong. I also changed the ScribeDocSubstitute to ScribeDocWriteValue and entered the key/value pair. But each time, an error occurs, telling me that I'm using an unknown tag (the "key" of the key/value pair). I presume that the key I'm using is not the actual name of the control field but not sure how to get that info since ScribeDocListFields returns a NULL value. Suggestions?
March 28, 20169 yr Daniel, Seeing as this is a government document - is it possible for me to get a copy to do my own tests? You can message me on the forums to keep it private.
March 28, 20169 yr I gave the file an in-depth look. It was created with a version of word 2003 or earlier, and the fields you are trying to change are write protected. Unfortunately just using Word to convert it from .doc to .docx won't do the trick with those fields. I was able to replace the text using ScribeDocSubstitute just using the name in between the asterisks, not the asterisks. Unfortunately this is ugly. I would recommend recreating the document or requesting the creator's update it. Scribe can't work with the control fields on the .doc file.
Create an account or sign in to comment