Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

Hey, Scripting Guy! How Can I Copy Specified Sections of an .RTF File to a New Word Document?

(image) Hey, Scripting Guy! I have large files output by a reservoir simulator, files I use to predict oil, water and gas movements in hydrocarbon reservoirs. These files are finite-difference numerical simulators, and work by timestep (i.e. a time interval, usually about 90 days); when they have finished calculating, they chuck out a bunch ...

Hey, Scripting Guy! How Can I Randomly Assign a Font to Characters in a Word Document?

(image) Hey, Scripting Guy! I’ve come up with a way to imitate handwriting in a document, but I need some help. Because real handwriting is characterized by variability, I had the idea of using four slightly-different fonts, taken from my actual handwriting, and then randomly assigning a font to each letter. I think that would imitate ...

How Can I Run a Macro After Opening Up Word?

(image) Hey, Scripting Guy! How can I run a specified Word macro after opening Word using a script?-- JD(image) (image) (image) Hey, JD. You know, when they first tested the atomic bomb a number of physicists had legitimate fears that the bomb might set off an unstoppable chain reaction that would end up destroying the entire world. We have ...

How Can I Insert Text Into an Existing Microsoft Word Bookmark?

(image) Hey, Scripting Guy! How can I insert text into an existing Microsoft Word bookmark?-- WM(image) (image) (image) Hey, WM. Believe it or not, this turned out to be the most difficult script the Scripting Guy who writes this column has ever had to create. Not because the script itself is very hard; as you’re about to see, it’s not...

How Can I Get a Total Page Count for All the Word Documents in a Folder?

(image) Hey, Scripting Guy! How can I get a total page count for all the Word documents in a folder?-- RA(image) (image) (image) Hey, RA. You’ll have to forgive the Scripting Guy who writes this column if he seems a little tired this morning. Yesterday was the first day of school in the Lake Washington School District and, as you might ...