Home > Back-end >  On the word problems.
On the word problems.

Time:09-20

Windows 7 environment, office 2013, Embarcadero c + + Builder 10.2, use the
Office2k WordApplication components,
What all don't say that code:
 String doc1="c: \ \ 1. Doc"; 
This - & gt; WordApplication1 - & gt; The Documents - & gt; Open (the Variant (doc1 c_str ()));
This - & gt; WordApplication1 - & gt; The Visible=true;
This - & gt; WordApplication1 - & gt; Selection - & gt; Text=(would be *) Text (" haha ");

Function: this code open 1. Doc document, enter text "haha,"
Problem: input "haha" within the word behind also entered many garbled, see below:

To solve the,

CodePudding user response:

Modify the code and then we have a problem,
 String doc1="c: \ \ 1. Doc"; 
UnicodeString as="12345678900987654321";
This - & gt; WordApplication1 - & gt; The Documents - & gt; Open (the Variant (doc1 c_str ()));
This - & gt; WordApplication1 - & gt; The Visible=true;
This - & gt; WordApplication1 - & gt; Selection - & gt; Text=as w_str ();

After the input character USES the UnicodeString coding, will not enter the code, but only the output characters, (FFFF is in the original picture is some content,)

Strives for the truth,
  • Related