我想把页面改成横向,已用宏录制了代码
With ActiveDocument.Styles(wdStyleNormal).Font
        If .NameFarEast = .NameAscii Then
            .NameAscii = ""
        End If
        .NameFarEast = ""
    End With
    With ActiveDocument.PageSetup
        .LineNumbering.Active = False
        .Orientation = wdOrientLandscape
        .TopMargin = CentimetersToPoints(3.17)
        .BottomMargin = CentimetersToPoints(3.17)
        .LeftMargin = CentimetersToPoints(2.54)
        .RightMargin = CentimetersToPoints(2.54)
        .Gutter = CentimetersToPoints(0)
        .HeaderDistance = CentimetersToPoints(1.5)
        .FooterDistance = CentimetersToPoints(1.75)
        .PageWidth = CentimetersToPoints(29.7)
        .PageHeight = CentimetersToPoints(21)
        .FirstPageTray = wdPrinterDefaultBin
        .OtherPagesTray = wdPrinterDefaultBin
        .SectionStart = wdSectionNewPage
        .OddAndEvenPagesHeaderFooter = False
        .DifferentFirstPageHeaderFooter = False
        .VerticalAlignment = wdAlignVerticalTop
        .SuppressEndnotes = False
        .MirrorMargins = False
        .TwoPagesOnOne = False
        .BookFoldPrinting = False
        .BookFoldRevPrinting = False
        .BookFoldPrintingSheets = 1
        .GutterPos = wdGutterPosLeft
        .LayoutMode = wdLayoutModeLineGrid
    End With
End Sub我该怎么将上述代码翻译成VC语言??

解决方案 »

  1.   

    把with,end with拿掉,所有的"."换成"->",所有前面没有东西的“.”前面加上ActiveDocument
      

  2.   

    兄弟,我发的不是VB代码,是VBA代码,你说的方法跟本就不对。
      

  3.   

    我说的只是语法的转换,转成VC的话要做很多工作,需要先初始化OLE,获取到ActiveDocument对象,然后按我写的转换。这一段代码VB,VBA有区别吗?
      

  4.   

    vba和vb语法上没有区别
    因为哪种我都看不懂
      

  5.   

    翻译成VC哪有那么简单
    看看人家怎么写的
    http://www.vckbase.com/document/viewdoc/?id=1737