Copy between 2 Winword files

%3CLINGO-SUB%20id%3D%22lingo-sub-354124%22%20slang%3D%22en-US%22%3ECopy%20between%202%20Winword%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-354124%22%20slang%3D%22en-US%22%3E%3CP%3EGreeting%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%202%20Winword%20file%20DOCA%20(3%20lines%20txt)%20and%20DOCB%20(5%20lines%20txt)%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20task%20is%20append%20the%20DOCA%20to%20DOCB%20make%20the%20new%20DOCB%20as%208%20lines%20(5%2B3)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20open%20DOCA%20and%20copy%20the%20content%20to%20the%20clipboard%2C%20then%20close%20DOCA%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethen%20I%20open%20DOCB%2C%20paste()%20the%20clipboard%2C%20What%20I%20found%2C%20once%20I%20did%20the%20paste()%2C%20and%20close%20DOCB%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethe%20content%20in%20DOCB%20is%203%20lines%20which%20from%20DOCA.%20is%20not%20what%20I%20am%20try%20to%20get%208%20lines.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eanyone%20can%20help.%20what%20is%20wrong%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3Eusera%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eby%20the%20way%2C%20if%20I%20open%20DOCB%20only%20and%20use%20following%20code.%3C%2FP%3E%3CP%3E%24objSelection.TypeParagraph()%3CBR%20%2F%3E%24text%20%3D%20%22Append%20TX%22%3CBR%20%2F%3E%24objSelection.TypeText(%24text)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eand%20close%20DOCB%2C%20DOCB%20get%20update%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-354124%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Occasional Visitor

Greeting,

 

I have 2 Winword file DOCA (3 lines txt) and DOCB (5 lines txt),

 

My task is append the DOCA to DOCB make the new DOCB as 8 lines (5+3)

 

I open DOCA and copy the content to the clipboard, then close DOCA

 

then I open DOCB, paste() the clipboard, What I found, once I did the paste(), and close DOCB

 

the content in DOCB is 3 lines which from DOCA. is not what I am try to get 8 lines.

 

anyone can help. what is wrong

 

Thanks

usera

 

by the way, if I open DOCB only and use following code.

$objSelection.TypeParagraph()
$text = "Append TX"
$objSelection.TypeText($text)

 

and close DOCB, DOCB get update

 

 

 

0 Replies