12-03-2009, 02:37 AM
Hello,
I take screenshots and write them to word documents. When I add the second screenshot it is added in the first page and the image in the first page is moved to the second page. Is there a way to add an image at in the second page ? In other words I want to add new pages in Word at the bottom of the current page (not on the top)
Thanks,
Raj
I take screenshots and write them to word documents. When I add the second screenshot it is added in the first page and the image in the first page is moved to the second page. Is there a way to add an image at in the second page ? In other words I want to add new pages in Word at the bottom of the current page (not on the top)
Code:
Dim Wrd
Dim WrdDoc
Const Wrdalignpgraphleft=1
Set Wrd=CreateObject("Word.Application")
Const wdOrientLandscape = 1
Wrd.Visible=False
Set WrdDoc=Wrd.Documents.Open (WordDocumentName , False)
Set Selection = Wrd.Selection
Selection.TypeText Comment & " -- Test Executed : "&NOW
Selection.TypeParagraph
WrdDoc.Range.Select
WrdDoc.Range.Select
With Wrd.ActiveDocument.PageSetup
.Orientation = wdOrientLandscape
.TopMargin = Wrd.InchesToPoints(0.92)
.BottomMargin = Wrd.InchesToPoints(0.92)
.LeftMargin = Wrd.InchesToPoints(0.30)
.RightMargin = Wrd.InchesToPoints(0.5)
.PageWidth = Wrd.InchesToPoints(12)
.PageHeight = Wrd.InchesToPoints(10)
End With
Set img= WrdDoc.InlineShapes.AddPicture(ConfirmationBMP, True)
img.Width=img.Width*1
img.Height=img.Height*1
img.range.paragraphformat.Alignment=Wrdalignpgraphcenter
WrdDoc.Save
WrdDoc.close
Wrd.Quit
Set Wrd=nothing
Set WrdDoc=nothing
Set WrdDocsel=nothing
Set img=nothing
Thanks,
Raj