Click here to Skip to main content
15,895,837 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 24-Jun-11 3:30am
v2

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


WordApp.Selection.InsertBreak Type:wdPageBreak


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


--
AJ
 
Share this answer
 
Comments
hansoctantan 24-Jun-11 10:27am    
thanks a lot, it works...
ankitjoshi24 24-Jun-11 10:28am    
You are welcome :-)
in this code
you can write in textbox then get the result in word document
VB
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
 
Share this answer
 
v2
Comments
hansoctantan 3-Oct-11 1:23am    
Actually this question has been answered months ago but still thanks for your post, I appreciate it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900