Double Exposure, Inc.
August 21, 2008, 02:44:11 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Bottom of the Box date TBD; location TBD. More information will be available soon!
 
Home Help Search Calendar Login Register
Pages: [1]   Go Down
  Print  
Author Topic: Word Macro Blues  (Read 252 times)
0 Members and 1 Guest are viewing this topic.
`_100003005030 (Zero)
Super Meeper
****
Online Online

Posts: 867


DOBA!


« on: January 08, 2008, 06:29:41 PM »

OK, I know M$ sucks, Word bites, etc.  Doesn't mean I don't have to deal with it.  So here's my problem.  (And for the record, we're talking Word 2003 on Windows XP.)

Periodically we have occasion to take a large number of Word files and run the same simple macro on each.  As you might imagine, much time is wasted in the trained monkey stuff: open file, run macro, close file.  When you have several dozen files, that's just insane.  (I could something similar in UNIX in a second, and in fact I have a utility for just this sort of thing.)

I'm aware of a program called MultiMacro, which purports to automate just this sort of thing.  Problem is, while the input files have a .doc extension, Word considers them "plain text", presumably because they don't contain any formatting yet.  So we either have to do a "Save as:" Word files, or just save, get the error message, and OK it to save as Word.  THAT's the part that looks like it will stymie MultiMacro, which seems to just want to take a list of files and go "open-macro-save" without any extra complications, like changing the format.

Just figured I'd see if anybody had any experience with the program and could answer, or knew of another way/program/whatever that would tackle the job.  Free or shareware preferred, but I'd consider commercial software that really did what I needed to do.

Linda (who wishes UNIX/LINUX ruled the world already)
Logged
klz_fc
Board Game Slave
Board Gaming Staff
Junior Meeper
****
Offline Offline

Posts: 146



« Reply #1 on: January 08, 2008, 07:52:09 PM »

Since it doesn't appear to show up strictly as an error, check Word's default settings. It sounds like Word is set to save files as plain text in the preferences, and if you change that back to Word format, you should be okay.
Logged
`_100003005030 (Zero)
Super Meeper
****
Online Online

Posts: 867


DOBA!


« Reply #2 on: January 08, 2008, 08:30:40 PM »

Not at all.  If I open a "real" Word file and click "Save As:", it defaults to Word.  But the files I'm running the macro in are plain text files with a .doc extension.  Word recognizes they're not REALLY Word files, and tries to save them back in the simpler format -- except then it would give me an error because it's no longer plain text once the macro is applied.  (The macro applies formatting -- changes font size, etc.)
Logged
klz_fc
Board Game Slave
Board Gaming Staff
Junior Meeper
****
Offline Offline

Posts: 146



« Reply #3 on: January 09, 2008, 08:55:06 PM »

Hmm....that is a problem. I wonder if there's a way to automate opening the text file and saving to Word format first then run the MultiMacro program. Not sure I can find anything, but I'll see if I can find anything else that might help.
Logged
Oni no Ted
Demonic Admin
Super Meeper
****
Offline Offline

Posts: 522


All your browser are belong to us


WWW
« Reply #4 on: January 09, 2008, 11:50:38 PM »

The macro command:
Code:
SAVE
saves the current doc in the default format

Code:
SAVEAS
pops the save as... dialog box, then waits for user input (file name, format, etc)

As far is I know there is not a way to automatically save a file in a different format Sad
Logged

Socket
Bringer of Chaos
Avatars
Super Meeper
*
Offline Offline

Posts: 762


BITE MY SHINY METAL @$$!


« Reply #5 on: January 10, 2008, 08:33:15 AM »

Well, depending on the text in the file, would it be possible to switch to RTF?  If you can, then a shell script (Perl, etc) should be able to apply the formatting you need.  If you're stuck with Word's .doc (at least the 2003 version) format, then its tougher.  I've seen samples of working with Word documents in shell scripts, like this: http://www.adp-gmbh.ch/perl/word.html

I had to deal with something like that for generating quote letters for customers, but went with RTF instead since it works just fine in Word and was easier to format in PHP.
Logged


`_100003005030 (Zero)
Super Meeper
****
Online Online

Posts: 867


DOBA!


« Reply #6 on: January 10, 2008, 08:58:03 PM »

I don't know about RTF -- never tried it for this, and not that familiar.  The formatting changes, as far as I remember, are just font size, font type, and margins.  The whole point is to make the file printable from Word.  (Otherwise it doesn't fit on a page.)

Linda
Logged
Socket
Bringer of Chaos
Avatars
Super Meeper
*
Offline Offline

Posts: 762


BITE MY SHINY METAL @$$!


« Reply #7 on: January 10, 2008, 10:59:16 PM »

Then RTF is the way to go.  I'll grab samples from what I did, but its fairly simple.  Its all text based, similar to html, but also somewhat programish.  Its an open format so it should be fairly simple to pull up samples like this.
Logged


`_100003005030 (Zero)
Super Meeper
****
Online Online

Posts: 867


DOBA!


« Reply #8 on: January 11, 2008, 11:34:55 PM »

Thanks.  I don't know Perl, actually, but if I can manage to set up, say, an awk or sed script to do it in UNIX, all the better.  (I can do the name change, reformat, and zip the darn thing in a shell script, and save a ton of Windowsy frustrations.  All I need to do is figure out what control codes I need, I guess.  I'm hoping it helps that they're all globally applied to the document.

Linda
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!

© 2008 Double Exposure, Inc. All rights reserved.