Form Fields in MS Word have 255 character limit

So with my school database that generates a word document for Final Report for students, it hit a wall with narrative/comments from teachers that's over 255 characters long. Instead of complaining long winded commentaries, I just had to fix this.

The best solution page, that is thorough enough, I am pasting its content here, lest it's taken down: (I basically just used ActiveDocument.Bookmarks("Bookmark1").Range.Text Instead of .FormFields("Bookmark1").Result.

Lynn,

I think if you have a better understanding of what's happening in Word
you'll be better able to come up with an acceptable solution.

First, you are correct that the character limit for formfields is 255. In
addition, you can set the .Result property of a formfield without removing
the protection from the document using something like:

ActiveDocument.FormFields("Text1").Result = "This is a string of less than
255 characters."

This is the basic nature of forms protection: the only place you can add
content to the forms-protected sections of the document is the formfields
within the section.

However, as you have found, if the content to be added exceeds the 255
character limit, setting the .Result property of the formfield doesn't work.
In this instance, you have a few options available to you. You can:

* Use the Trim function to truncate the string at 255 characters. This is
probably not an acceptable solution since you undoubtedly want the whole
string to appear in your document.

* Use multiple formfields and the Mid function to parse the string into
255 character "chunks", which then get inserted into various formfields using
the .Result property as described above. Again, this is a less-than-optimum
solution because it's clunky and may not produce an especially attractive
result.

* Use a bookmark and something like the following to insert the text:

ActiveDocument.Bookmarks("Bookmark1").Range.Text = "A long string of more
than 255 characters."

However, as you have discovered, this method requires the section containing
the bookmark to be unprotected (for the reasons discussed above), and you
have stated that making this section unprotected is not an option.

The best solution is to unprotect the document prior to inserting the text
and then reprotecting it again afterwards. The code for doing this would look
something like:

ActiveDocument.Unprotect "password"
ActiveDocument.Bookmarks("Bookmark1").Range.Text = "A long string of more
than 255 characters."
ActiveDocument.Protect wdAllowOnlyFormFields, True, "password"

(See the Word VBA help topics on document protection for more information on
this code.)

Only one thing concerns me: You say that you are "pushing" data from Excel
into Word. This makes me think that you are driving this process from the
Excel side rather than from Word. I'm not quite sure if you will be
successful in trying to unprotect a Word document using code from within
Excel. This being the Word VBA forum, I suspect that most contributors would
take the approach of "pulling" data from Excel using code in Word - and thus
would not have to worry about this potential problem. However, some of us do
"cross over" so maybe someone else will be able to help you with this
possible sticking point. Otherwise, I can only suggest that you ask the
question in the Excel VBA forum.
--
Cheers!
Gordon

Posted in Technical | Leave a comment

Aquarium Status (4/15/2022 1:22PM):

Continued from last entry.

Temperature: 77.3F
Seneye: 77.558F

Salinity: 1.0285 specific gravity

pH:
HANNA Checker: 7.8

Nitrate:
HANNA Checker: 20.6 ppm

Phosphate:
HANNA Checker: 0.73 ppm

Alkalinity:
HANNA Checker: 164 ppm = 164 x 0.056 dkH = 9.184 dkH

After that, 50+% water change, added Microbe-Lift (40ml), Marine Buffer (< 1 capful), Fluval Sea: Iodine, Trace Elements, 3-IONS, Calcium.

Posted in Biology | Leave a comment

Carport Project

Since Nadia keeps talking about it, to put a roof above our car when parked in our driveway, I figure this is a good project to look into and build it myself.

https://www.youtube.com/results?search_query=build+carport

Youtube has many good resources above.

Considerations:

  • Minimum 4 posts. The leg support should not be dependent on the house's side at all.
  • Roof should lean - for easy snow clearing.
  • Watch for roof flow does not extend to the neighbor's side.
  • Consider roof size for solar panels installation potential.
Posted in Projects, Technical | Leave a comment

Reasons I leave a church

After careful consideration, this is my conclusion:

The reason I would leave a church that I've been with around for a while, is the same reason I have applied in the past: When the hindrance of proper evangelism becomes obvious, that the very church is the cause of it, it is time for me to leave that church.

With Chinese churches, the hindrance is usually in the context of 利害关系;
With American churches, the hindrance is usually in the context of Americanism.

Gospel-centeredness is the beating heart of a church, without it, the church heads towards senility, if not mutation or destruction.

Posted in Theologization | 1 Comment

Torchlighters - Cartoon Series on Heroes of the church

One quick way to learn of church history: https://torchlighters.org/heroes/

Posted in Theologization | Leave a comment

Thoughts

So tonight's (4/14) Bible Study, I brought up the analogy to evangelism from the Raising Lazarus passage in John 11. The pastor tried to reject it fearing it has connection to allegory (hidden meaning), but later admitted such possibility as application (when preached in sermon). I replied that I liked that "application", hinting that that's basically what I was talking about. I personally don't see much difference between analogy, allegory or application in this case, they are just words. Earlier, there was also discussion on Jesus Wept. The pastor still stuck to his same reasoning. I recall Dirk had in the last Sunday School added the explanation similar to Pak Tong's, that it was the same reason Jesus wept over Jerusalem, the stubbornness of sinners, when the pastor gave only one reason: how broken the world is by death, which I believe can be acceptable, if it must be taken, but a lower class reasoning, because Jesus conquered death and His attitude to face death is not that of a crying baby, but as a warrior.

Nadia fell in the evening of 4/14/2022 around 4:46pm and almost hit her head to the corner of the fire pit. I thank God for the save. Only a few light bruises on the arms and right cheek. Most damage was the lower right lips with very minor tears. I checked the camera video, had she hit the corner of that solid rock pit, I do not dare to imagine what fatality we would be facing. I need to show her the video, she needs to learn to be aware of her surroundings.

They have several of these (fan compositions) from time to time, I must say, these 17 year old definitely have composition talents. I would ask where they learn these techniques, and I doubt it's hard to find, but I do not have the time and energy to venture into this for now.

Posted in Music | Leave a comment

Roof Project - Rid of critters nest

Looks like there's a hole in the soffit near the mudroom. Critters/birds? movement could be heard in the mudroom on the ceiling sometimes.

I went out from the master bedroom's window all the way to the roof of the mudroom, measured 8"x24" hole that I need to patch.

Will go to home depot soon.

Posted in Technical | Leave a comment

Outlook Preview PDF failed

First of all, to preview word/excel, etc. in Outlook, the Office apps must be all in the same version, so said google.

Solution: Now, for PDF preview, Office/Outlook does not provide this, it's said to be provided by Adobe. Therefore, Adobe reader and Outlook must be in the same bit. (32bit or 64bit).

Solution source: https://support.microsoft.com/en-us/office/outlook-pdf-preview-error-this-file-cannot-be-previewed-because-there-is-no-previewer-installed-for-it-b78bfe24-ba13-44bd-8289-1919ece7ded2

Posted in Technical | Leave a comment

Is Google Drive View-Only PDF really protected from being copied?

Of course, nothing can escape Snipping Tool screenshot.

But what about the shortest way to convert to a pdf document file? Because Google Drive somehow, giving the ability to restrict viewers from downloading if the owner so chooses, convert the pdf into some partly encoded html format such that the printing will be blank.

The solution I've seen so far is from this site. Using JavaScript, we can play with rendering picture/text.

Basically injecting a JS code (ctrl+shift+c) in console, which I will paste below. After hitting Enter and closing the console window, the Save As dialog box shows up and the pdf file saved is not bad.

JS Code:

let jspdf = document.createElement("script");
jspdf.onload = function () {
let pdf = new jsPDF();
let elements = document.getElementsByTagName("img");
for (let i in elements) {
let img = elements[i];
console.log("add img ", img);
if (!/^blob:/.test(img.src)) {
console.log("invalid src");
continue;
}
let can = document.createElement('canvas');
let con = can.getContext("2d");
can.width = img.width;
can.height = img.height;
con.drawImage(img, 0, 0, img.width, img.height);
let imgData = can.toDataURL("image/jpeg", 1.0);
pdf.addImage(imgData, 'JPEG', 0, 0);
pdf.addPage();
}
pdf.save("download.pdf");
};
jspdf.src = 'https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js';
document.body.appendChild(jspdf);

This is another solution: https://github.com/zeltox/Google-Drive-PDF-Downloader

And another, but very similar with the above two:

Posted in Technical | Leave a comment

Thoughts

When someone blindly copies others, though knowing the worth of what they copied, and do not think it through, she would quote it at the wrong time, in the wrong occasion, not being relevant, not connecting the dots, not getting the points brought up by others, to her own shame. The more she boasts of it, the more the shame it is.

One thing is becoming more and more obvious: That this is a crucial key to separate those true Christians from the confused christians, or at least, identifying the ones who with all methods showing how faithful to God they are, either with praise or testimonies, are actually despicable in the very acts they thought are right before God:

You either treat God as your Lord; or you treat God as your tools.

An example of the latter, from Facebook, from time to time, I see this Malaysian lady who married to USA, to a white man, had a son who allegedly did so well in the material world that she is praising God for. There's nothing else she praises God for, except the success of her son, her bitcoin profits, etc.

Do we praise God for God? Or do we praise God for what blessings He has bestowed upon us? As if we are only happy when He did something for us. Are we self centered? Or God centered? This sadly is not even a struggle for them, but a justification, because they are so disillusioned in themselves that they do not even see that as sinful. They believe this is all for God.

For these folks, they would need to consider one thing that Moses and Paul brought up: If for the glory of God, I should go to hell, I am willing.

I guarantee they cannot understand this. For their motive of praising God ultimately, is for themselves. Not for God. They would seek to twist those verses. They would say: Oh, yea, I say I go to hell for God, but actually God will not let me do that, so basically that is just a pretend, pretend to say I would suffer hell for God's sake, for how can God, being good to me, let me go through that? So by saying that, they have made Moses and Paul a joke for saying that. The spirit of God is not with these pretenders. In the end of the day, they would asked: LORD LORD! Haven't we praised your name before others?

Posted in Theologization | Leave a comment