2017-01-13 34 views
1

美好的一天。我希望向社区询问从OPENEDGE/PROGRESS 4GL到MSWORD的简单出口。我目前的进展版本是9.1E。这里是从其他网站的几个编辑后,我的示例代码:从OPENEDGE导出字符到MS WORD时编辑格式

DEFINE VARIABLE chWordApplication AS COM-HANDLE NO-UNDO. 
DEFINE VARIABLE AppWordDocs AS COM-HANDLE NO-UNDO. 
DEFINE VARIABLE cMonthList AS CHARACTER NO-UNDO 
INIT "January,February,March,April,May,June,July,August,September,October,November,December". 

DEF VAR ch-par AS CHAR FORMAT 'x(500)'. 
DEF VAR cc AS CHAR. 

ASSIGN cc = 'cc:File' 
    ch-par = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.". 

CREATE "Word.Application" chWordApplication. 
chWordApplication:documents:Open("<file path>\<file>.doc",False,False,False,"","",False). 

AppWordDocs=chWordApplication:ActiveDocument. 

chWordApplication:VISIBLE=TRUE. 

chWordApplication:selection:TypeParagraph. 

chWordApplication:Selection:typetext(ch-par). 

chWordApplication:selection:TypeParagraph. 
chWordApplication:selection:TypeParagraph. 

chWordApplication:Selection:typetext(cc). 

/*chWordApplication:Quit().*/ 

RELEASE OBJECT chWordApplication. 
RELEASE OBJECT AppWordDocs.  

什么,我希望了解是设置CH-相提并论的理由,并抄送有一个加粗字体格式,无论使用什么字体样式。

感谢您的回答。 P.S. >将来会将此文件转换为PDF。目前正在寻找。

+0

美好的一天。我找到了我正在寻找的答案之一。将字符设置为BOLD格式。我使用chWordApplication:Selection:Font:Bold = TRUE.'和'chWordApplication:Selection:Font:Bold = false.'来修改它。格式到JUSTIFY是唯一缺乏的东西。 – noob

回答

0

chWordApplication:Selection:ParagraphFormat:Alignment = 3.