>>So mainconcern is to save as text from embedded word doc.
>
>Thank you very much for your suggestions, but that's not it either. We don't want separate files, or we would use linking instead of embedding. We just need to find out how many lines of text have been typed in the field (so we can decide where to print it), something like the MEMLINES function for memos. What I have been looking for is a way to pass just the text portion of the embedded document to a function for evaluation, but maybe that just isn't possible.
>
>I've probably been going about it all wrong... what about this: Word keeps track of information like number of paragraphs, lines, characters, etc., under File Properties. Is there some way to return those statistics about the embedded document when the user is finished editing it?
Yes, you could get statistics. Check out the word command "ComputeStatistics". Syntax is :
expression.ComputeStatistics(Statistic, IncludeFootnotesAndEndnotes)
or
expression.ComputeStatistics(Statistic)
Syntax 1 expression is Document, 2 Range.
Statistic could be anyone of these : wdStatisticCharacters, wdStatisticCharactersWithSpaces, wdStatisticLines, wdStatisticPages, wdStatisticParagraphs, or wdStatisticWords.
IncludeFootnotesAndEndnotes is optional (logical).
This info correspond to "Tools\Word count" or "Files\Properties\Statistics" in menu.
#include "wdconst.h"
lcDocName = "c:\DocPath\Mydoc.doc"
oWordDocument=createobject("word.application")
WITH oWordDocument
.documents.open(lcDocName)
WITH .ActiveDocument
? "Chars: ",.ComputeStatistics(wdStatisticCharacters)
? "Charswspaces: ",.ComputeStatistics(wdStatisticCharactersWithSpaces)
? "Lines: ",.ComputeStatistics(wdStatisticLines)
? "Pages: ",.ComputeStatistics(wdStatisticPages)
? "Paragraphs: ",.ComputeStatistics(wdStatisticParagraphs)
? "Words: ",.ComputeStatistics(wdStatisticWords)
ENDWITH
.Application.Quit(wdDoNotSaveChanges)
ENDWITH
Cetin