使用VB6在Word文档中插入/添加空白页 [英] Insert/Add blank page to Word Document using VB6

查看:290
本文介绍了使用VB6在Word文档中插入/添加空白页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我使用VB6创建Word文档的代码

This is my code for creating a Word Document using VB6

Dim WordApp As Word.Application
Dim WordDoc As Word.Document

Set WordApp = New Word.Application
Set WordDoc = WordApp.Documents.Add

With WordApp.Selection
    .InlineShapes.AddPicture "D:\tantan\FLOS\devil-may-cry-anime.jpg", False, True
    .Hyperlinks.Add Anchor:=.Range, Address:="http://www.google.com/", SubAddress:="", TextToDisplay:="Google"
    .Font.Bold = True
    .TypeText "aaaa"

    .Font.Bold = False
    .TypeText "bbbb"

    .TypeText vbNewLine

    .Font.Italic = True
    .TypeText "cccc"
    .TypeText "dddd"
End With

WordDoc.SaveAs FileName:="D:\Samples\" & Text1.Text & ".doc"
WordDoc.Close False
WordApp.Quit False


有人可以张贴一些代码来编写如何具有多个空白页的文档.


Can someone post some codes on how to write a document with multiple blank pages.

推荐答案


您可以尝试通过分页来添加新页面.


Hi
you can try to add new pages by doing a page-break.


WordApp.Selection.InsertBreak Type:wdPageBreak



在需要新空白页的代码中使用它.


-
AJ



Use it in your code where you want a new blank page.


--
AJ


此代码中的
您可以在文本框中编写文字,然后在Word文档中获取结果
in this code
you can write in textbox then get the result in word document
Set wrdapp = New Word.Application
With wrdapp
.Documents.Add
.ActiveDocument.Content.Font.Bold = True
.ActiveDocument.Paragraphs.Alignment = wdAlignParagraphRight
.ActiveDocument.Content.Font.Color = wdColorRose
.ActiveDocument.Content.Font.Italic = True
.ActiveDocument.Content.Font.Name = "Tahoma"
.ActiveDocument.Content.Font.Size = 22
.ActiveDocument.Content.Text = Text1.Text
.ActiveDocument.Content.InsertAfter Text:="Good Luck"
.Visible = True
End With


这篇关于使用VB6在Word文档中插入/添加空白页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆