我现在用vb操作word,第一页是封面。我封面做完后怎么跳转到第二页生成内容。
这是我的封面代码:
Sub Cover()
Set orange = ActiveDocument.Range(Start:=0, End:=0)
With orange
.InsertAfter Text:=Text1.Text
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter.InsertParagraphAfter
.Font.Name = 宋体
.Font.Size = 24
End With
End Sub
Private Sub Command1_Click()
Dim LoadStr As String
Set MyWord = CreateObject("Word.Application")
MyWord.Visible = True
Set NewDoc = Nothing
Set NewDoc = MyWord.Documents.Add
Call Cover
................
...............
End Sub
在上述的省略号中我再想生成文本的内容,但不知道怎么设置,使文本从第二页开始。这个该如何操作,请求达人帮助!!
这是我的封面代码:
Sub Cover()
Set orange = ActiveDocument.Range(Start:=0, End:=0)
With orange
.InsertAfter Text:=Text1.Text
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter.InsertParagraphAfter
.Font.Name = 宋体
.Font.Size = 24
End With
End Sub
Private Sub Command1_Click()
Dim LoadStr As String
Set MyWord = CreateObject("Word.Application")
MyWord.Visible = True
Set NewDoc = Nothing
Set NewDoc = MyWord.Documents.Add
Call Cover
................
...............
End Sub
在上述的省略号中我再想生成文本的内容,但不知道怎么设置,使文本从第二页开始。这个该如何操作,请求达人帮助!!
http://hi.baidu.com/jebeljebel/blog/item/a4a43a38776fdbc7d56225b4.html
封面如果是第一页,在第一页后加其它内容!
可以通过以下代码来实现选择此封面的最后,再插入分节符转至第二页开始
sub newpage()
dim x as integer
dim r as range
x=activedocument.range.end
set r=activedocument.range(x-1,x)
r.InsertBreak Type:=wdSectionBreakNextPage
end sub
试试应该可以
activedocument.Books.Add name:="书签名称" range:=selection.Range
end sub
sub return_book()'返回书签所在的位置
Selection.GoTo what:=wdGoToBook, Name:="书签名称"
end sub
sub delete_book()'删除书签
ActiveDocument.Books("书签名称").Delete
end sub
具体的自己考虑怎么用。