Jump to content
Server Maintenance This Week. ×

Scribe Substitute for MS Word Placeholder Text


This topic is 2950 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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).

 

 

Scribe_Orig_doc.png

Scribe_substituteScript.png

Scribe_New_doc.png

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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?

Scribe_Unknown_tag.png

Scribe_ListFields.png

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 2950 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.