Use Word to print the content of Kingsoft Powerword.

Source: Internet
Author: User

When the content in Kingsoft phonetic is exported as a text file, the phonetic symbol is replaced by a specific symbol. You must change it to the font Kingsoft phonetic that is attached to Kingsoft phonetic. However, if there are many new words, It is very laborious to modify them one by one.

Example of the exported file:

+ Petty
/Adj. Small, unimportant, small, small, subtle, small, mean
& 5 PETI
+ Phase
/N. Stage, state, phase, phase
/V. Phase
& Feiz
Therefore, I used Word VBA to write a macro and used it to automatically change the font.

The Code is as follows:

Sub macro2 ()
'
'Macro2 macro
'Macro in? L1t recording
'
??? Selection. Find. clearformatting 'find the row whose first character is "&"
??? With selection. Find
??????? . Text = "&"
??????? . Replacement. Text = ""
??????? . Forward = true
??????? . Wrap = wdfindcontinue
??????? . Format = false
??????? . Matchcase = false
??????? . Matchwholeword = false
??????? . Matchbyte = true
??????? . Matchwildcards = false
??????? . Matchsoundslike = false
??????? . Matchallwordforms = false
??? End
??
??? Selection. Find. Execute
??? If selection. characters. First. Text "&" then
??????? Exit sub 'can be optimized in the future. Otherwise, the entire article will be checked, and it will be too wasteful to execute the search.
??? End if
???? Selection. Delete unit: = wdcharacter, Count: = 1 'delete "&" characters
??? Char = selection. moveenduntil (cset: = vbcr, Count: = 100 )'
??? Selection. Font. Name = "Kingsoft phonetic plain" 'set the font
???
End sub
Sub AAA ()
??? For I = 1 to 400 queries 400 times, 400 words at a time tired
??????? Macro2
??? Next I
End sub


Result After change

+ Petty

/Adj. Small, unimportant, small, small, subtle, small, mean

5 PETI

+ Phase

/N. Stage, state, phase, phase

/V. Phase

Feiz

?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.