Microsoft Word Macro在SAS中调用

时间:2016-05-27 14:52:32

标签: vba formatting sas ms-office border

我创建了一个名为DoubleBorders的自定义Microsoft Word宏,它可以实现这一点 - 在文档中的所有表上放置双边框。 VBA代码是:

Sub TableNoBorders()
    Dim tbl As Table
    For Each tbl In ActiveDocument.Tables
        tbl.Borders.OutsideLineStyle = wdLineStyleDouble
        tbl.Borders.InsideLineStyle = wdLineStyleSingle 
    Next
End Sub

当我从SAS输出RTF文件时,是否可以调用此代码并输出具有双边框的表?

DATA TEST;
    INPUT CAR $12. YEAR;
    DATALINES;
    CHEVY   2001
    FORD    2005
    HONDA   2008
    ;
RUN;

ODS RTF FILE= "C:\Users\Documents\SAS Example Code\Test.rtf" STYLE=STATISTICAL;

** maybe insert code here to call my custom VBA DoubleBorders macro? **;

PROC REPORT DATA = TEST NOWD;
    COLUMN CAR YEAR;
    DEFINE CAR / DISPLAY "Car";
    DEFINE YEAR / DISPLAY "Year";
RUN;

ODS RTF CLOSE;

0 个答案:

没有答案