bobbit31
perfect, it is bigger now, but the margins have pushed it off the page, any suggestion on how to get rid of/ set the margins? you've already got the 250 points. I will increase it another 50 for this answer!
Main Topics
Browse All TopicsHello,
I have a batch file that will run a vbscript to automatically print out a gif image. It works quite nicely except for one small problem, the image is to small. I need it to fill the size of the paper (8.5X11). This is the script I have:
wdOrientLandscape=1
Set Args=WScript.Arguments
FileName=Args(0)
Set Word = WScript.CreateObject("Word
Word.Documents.Add
Set Doc = Word.ActiveDocument
Doc.InlineShapes.AddPictur
Doc.PageSetup.Orientation = wdOrientLandscape
Doc.PrintOut
Word.ActiveDocument.Close False
Word.Quit
If anyone has any suggestions, I would greatly appreciate them!
Brian
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
the below set's top, bottom, left, and right margins to .25"
With Doc.PageSetup
.TopMargin = InchesToPoints(0.25)
.BottomMargin = InchesToPoints(0.25)
.LeftMargin = InchesToPoints(0.25)
.RightMargin = InchesToPoints(0.25)
.Gutter = InchesToPoints(0)
End With
also, for future reference, a good way to figure out how to do the above things is to open up word, and record a macro (of what you are trying to do)... then go in and edit the macro to see what the code should be. :)
this is what i have so far:
wdOrientLandscape=1
Set Args=WScript.Arguments
FileName=Args(0)
Set Word = WScript.CreateObject("Word
Word.Documents.Add
Set Doc = Word.ActiveDocument
With Doc.PageSetup
.TopMargin = InchesToPoints(0.25)
.BottomMargin = InchesToPoints(0.25)
.LeftMargin = InchesToPoints(0.25)
.RightMargin = InchesToPoints(0.25)
.Gutter = InchesToPoints(0)
End With
Doc.InlineShapes.AddPictur
Doc.InlineShapes(1).Height
Doc.InlineShapes(1).Width =765
Doc.PageSetup.Orientation = wdOrientLandscape
Doc.PrintOut
Word.ActiveDocument.Close False
Word.Quit
ok, this is what i have, but i am still getting the same error:
wdOrientLandscape=1
Set Args=WScript.Arguments
FileName=Args(0)
Set Word = WScript.CreateObject("Word
Word.Documents.Add
Set Doc = Word.ActiveDocument
With Doc.PageSetup
.TopMargin = Doc.Application.InchesToPo
.BottomMargin = InchesToPoints(0.25)
.LeftMargin = InchesToPoints(0.25)
.RightMargin = InchesToPoints(0.25)
.Gutter = InchesToPoints(0)
End With
Doc.InlineShapes.AddPictur
Doc.InlineShapes(1).Height
Doc.InlineShapes(1).Width =765
Doc.PageSetup.Orientation = wdOrientLandscape
Doc.PrintOut
Word.ActiveDocument.Close False
Word.Quit
Business Accounts
Answer for Membership
by: bobbit31Posted on 2003-07-10 at 11:15:43ID: 8895319
after you do the AddPicture:
= <you specify>
Doc.InlineShapes(1).Height
Doc.InlineShapes(1).Width = <you specify>