Merging/Append 2 Word Documents

April 1, 2010 at 02:21:28
Specs: Windows XP
Hi All,
I would need some help in Perl script merging/Appending 2 word documents into Single Word Document.

Thanks in advance.
-Anand.



See More: Merging/Append 2 Word Documents

Report •

#1
April 3, 2010 at 18:38:13
i doubt if this will help you much, but since nothing else has been offered, i'll put it out here (qbasic - easily adaptable to visbasic, also doable in vbscript:
'unword.bas: pull text out of a "word" document
INPUT "FILE (NO EXTENSION): ", F$
FF$ = F$
F$ = F$ + ".DOC"
'this just finds the length of the file
OPEN F$ FOR APPEND AS #1
EF = SEEK(1)
CLOSE #1
OPEN F$ FOR BINARY ACCESS READ AS #1
OPEN FF$ FOR OUTPUT AS #2
'output-is-enabled flag: starts out "off"
SF = 0
DO WHILE NOT EOF(1)
X$ = INPUT$(1, #1)
C = ASC(X$)
IF SF = 1 THEN GOTO 10
'this signals the start of text, char 217 (jump 10)
IF C <> 217 THEN GOTO MLOOP
EE = SEEK(1)
SEEK #1, EE + 10
SF = 1
'just a debug helper
PRINT "*"
INPUT NUL$
GOTO MLOOP
10
'now just output everything "printable"
IF C = 13 THEN PRINT #2, "": GOTO MLOOP
IF C > 31 AND C < 128 THEN PRINT #2, X$;
PRINT X$
IF SEEK(1) >= EF OR C = 0 THEN EXIT DO
MLOOP:
LOOP
CLOSE


Report •
Related Solutions


Ask Question