Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automate Print-Screen to another program? 1

Status
Not open for further replies.

NorthNone

Programmer
Jan 27, 2003
445
0
0
US
Is there code out there for Office 2007 to automate the process of taking a print-screen of the current Access 2007 screen and printing it in landscape mode? I'm thinking of a print preview in Word 2007, but other ideas are welcome.
TIA
NorthNone
BTW I know that the ideal solution is to create a report, but there are many drill-down windows the user might have open and want to include in the print-screen. Powers-that-be say not to spend that much time...

"Talent hits a target no one else can hit; Genius hits a target no one else can see." --- Arthur Schopenhauer
 
The following routine by Randy Birch, should allow you to do this


Test it by commenting the last line, where he is putting the image into a form control.

I very much agree it isn't an ideal situation ;-)

You could automate Word and paste, here's some "air code", no guaranties, no errorhandling, just an idea...

[tt]dim w as object ' word.application
dim d as object ' word.document

' <code to fetch printscreen>

set w = createobject("word.application")
set d = w.documents.add
d.select
d.pagesetup.orientation = 1 'wsOrientLandscape
w.selection.paste
d.saveas "c:\test.doc"
d.close
set d = nothing
w.quit
set w = nothing[/tt]

Roy-Vidar
 
Roy, GREAT air-code. It works like a charm. I found the code to generate the initial print screen here:
Tip of the hat to aarondewberry who recently posted it.
A little error trapping and I'm in business.
Thanks so much!
NorthNone


"Talent hits a target no one else can hit; Genius hits a target no one else can see." --- Arthur Schopenhauer
 
I'm not sure what you're doing with Word - or whether using it was just a means to an end, but, for the sake of completeness, I should point out that you can automate the Print Screen key using WordBasic.

Code:
[blue]WordBasic.Sendkeys "{PrtSc}"[/blue]

If you're not using Word, you can instantiate WordBasic all by itself, although that might be excessive :)


Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top