要求输入两行单行句子。并且可以控制文字的大小
第三行开始输入长篇文字。关键是输入文字部分和控制文字大小部分的代码,谢谢!

解决方案 »

  1.   

    Option ExplicitPrivate Sub Command1_Click()
        '点击菜单 "工程/引用/Microsoft Word 9.0 Object Library"    Dim wd As New Word.Application
        
        wd.Documents.Add DocumentType:=wdNewBlankDocument
        '插入一个5列3行的表格
        wd.ActiveDocument.Tables.Add Range:=wd.Selection.Range, NumRows:=3, NumColumns _
            :=5, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
            wdAutoFitFixed
        
        wd.Selection.EndKey Unit:=wdStory '将光标移到最后
        wd.Selection.InsertBreak Type:=wdPageBreak '插入分页符
        wd.Visible = True
        wd.ShowMe
        
    End Sub
      

  2.   

    to  haohaohappy(爱靠冒险,工作靠拼)
     老大啊,我现在不想用表格的话,怎么办啊。我打印的是通知格式的东西
    需要标题、发送时间和通知内容。三个数据。其中我想对通知的标题居中,字体变大。发送时间居右。
      

  3.   

    我录制了这样一端宏,但是总是报错啊。我该添加些什么东西啊。
        Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
        Selection.Font.Size = 16
        Selection.Font.Bold = wdToggle
        Selection.TypeText Text:="sfdsdfsdfsdfsdf"
        Selection.TypeParagraph
        Selection.ParagraphFormat.Alignment = wdAlignParagraphJustify
        Selection.TypeText Text:="dfgfgdfgdfgdfg"
        Selection.TypeParagraph
        Selection.ParagraphFormat.Alignment = wdAlignParagraphRight
        Selection.TypeText Text:="dfdfdfdfdf"
      

  4.   

    Dim wd As New Word.Application
    wd.Documents.Add DocumentType:=wdNewBlankDocument
    wd.Selection.EndKey Unit:=wdStory '½«¹â±êÒƵ½×îºó
      wd.Visible = True
      With wd.Selection.ParagraphFormat
          .LeftIndent = CentimetersToPoints(0)
          .RightIndent = CentimetersToPoints(0)
          .SpaceBefore = 0
          .SpaceBeforeAuto = False
          .SpaceAfter = 0
          .SpaceAfterAuto = False
          .LineSpacingRule = wdLineSpace1pt5
          .Alignment = wdAlignParagraphJustify
          .WidowControl = False
          .KeepWithNext = False
          .KeepTogether = False
          .PageBreakBefore = False
          .NoLineNumber = False
          .Hyphenation = True
          .FirstLineIndent = CentimetersToPoints(0)
          .OutlineLevel = wdOutlineLevelBodyText
          .CharacterUnitLeftIndent = 0
          .CharacterUnitRightIndent = 0
          .CharacterUnitFirstLineIndent = 0
          .LineUnitBefore = 0
          .LineUnitAfter = 0
          .AutoAdjustRightIndent = True
          .DisableLineHeightGrid = False
          .FarEastLineBreakControl = True
          .WordWrap = True
          .HangingPunctuation = True
          .HalfWidthPunctuationOnTopOfLine = False
          .AddSpaceBetweenFarEastAndAlpha = True
          .AddSpaceBetweenFarEastAndDigit = True
          .BaseLineAlignment = wdBaselineAlignAuto
      End WithWith wd
        .Selection.Font.Size = 18
        .Selection.Font.Name = "ËÎÌå"
        .Selection.Font.Bold = wdToggle
        .Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
        .Selection.TypeText Text:=Frmtz_neirong.lbl_biaoti.Caption
        .Selection.TypeParagraph
        .Selection.ParagraphFormat.Alignment = wdAlignParagraphRight
        .Selection.Font.Size = 12
        .Selection.Font.Bold = wdToggle
        .Selection.TypeText Text:=Frmtz_neirong.lbl_fssj.Caption
        .Selection.TypeParagraph
        .Selection.ParagraphFormat.Alignment = wdAlignParagraphJustify
        .Selection.TypeText Text:=Frmtz_neirong.RichTextBox1.Text
    End With
    wd.Visible = True
    wd.ShowMe