Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Resizing and Printing a UserForm

Hi,
I have a UserForm that I needed to print out on a 5'x8' sheet.
Currently I have (thanks to this forum)

Public Const VK_SNAPSHOT = 44
Public Const VK_LMENU = 164
Public Const KEYEVENTF_KEYUP = 2
Public Const KEYEVENTF_EXTENDEDKEY = 1
Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As
Long)
sub main()
'deleted code
UserForm1.show
End Sub

Private Sub print_form_Click()
DoEvents
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY + _
KEYEVENTF_KEYUP, 0
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY + _
KEYEVENTF_KEYUP, 0
DoEvents
Workbooks.Add
Application.Wait Now + TimeValue("00:00:01")
ActiveSheet.PasteSpecial Format:="Bitmap", Link:=False,
DisplayAsIcon:=False
ActiveSheet.Range("A1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
ActiveWorkbook.Close False
Unload Me
End Sub

However, this is simply a screenshot and I can't seem to figure out
how to size it down (even with fooling with the numbers). Are there
any calculated or more exact resizing methods? Or maybe more
parameters I could include?

Thank you very much

-Andrew

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Resizing and Printing a UserForm

5 feet by 8 feet?????????? <vbg

Since you're only printing a worksheet, maybe you could just do the equivalent
of File|Page setup|Page Tab|Adjust to %.

Add a line like:

ActiveSheet.PageSetup.Zoom = 70
Before the .Printout command

In fact, you could experiment by commenting these lines:

' ActiveWindow.SelectedSheets.PrintOut Copies:=1
' ActiveWorkbook.Close False

Then when the code stops, you could resize it manually to make it fit the way
you want. Then modify the code to use that percentage.



wrote:

Hi,
I have a UserForm that I needed to print out on a 5'x8' sheet.
Currently I have (thanks to this forum)

Public Const VK_SNAPSHOT = 44
Public Const VK_LMENU = 164
Public Const KEYEVENTF_KEYUP = 2
Public Const KEYEVENTF_EXTENDEDKEY = 1
Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As
Long)
sub main()
'deleted code
UserForm1.show
End Sub

Private Sub print_form_Click()
DoEvents
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY + _
KEYEVENTF_KEYUP, 0
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY + _
KEYEVENTF_KEYUP, 0
DoEvents
Workbooks.Add
Application.Wait Now + TimeValue("00:00:01")
ActiveSheet.PasteSpecial Format:="Bitmap", Link:=False,
DisplayAsIcon:=False
ActiveSheet.Range("A1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
ActiveWorkbook.Close False
Unload Me
End Sub

However, this is simply a screenshot and I can't seem to figure out
how to size it down (even with fooling with the numbers). Are there
any calculated or more exact resizing methods? Or maybe more
parameters I could include?

Thank you very much

-Andrew


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Resizing and Printing a UserForm

On Apr 17, 5:46 pm, Dave Peterson wrote:
5 feet by 8 feet?????????? <vbg

Since you're only printing a worksheet, maybe you could just do the equivalent
of File|Page setup|Page Tab|Adjust to %.

Add a line like:

ActiveSheet.PageSetup.Zoom = 70
Before the .Printout command

In fact, you could experiment by commenting these lines:

' ActiveWindow.SelectedSheets.PrintOut Copies:=1
' ActiveWorkbook.Close False

Then when the code stops, you could resize it manually to make it fit the way
you want. Then modify the code to use that percentage.



wrote:

Hi,
I have a UserForm that I needed to print out on a 5'x8' sheet.
Currently I have (thanks to this forum)


Public Const VK_SNAPSHOT = 44
Public Const VK_LMENU = 164
Public Const KEYEVENTF_KEYUP = 2
Public Const KEYEVENTF_EXTENDEDKEY = 1
Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As
Long)
sub main()
'deleted code
UserForm1.show
End Sub


Private Sub print_form_Click()
DoEvents
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY + _
KEYEVENTF_KEYUP, 0
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY + _
KEYEVENTF_KEYUP, 0
DoEvents
Workbooks.Add
Application.Wait Now + TimeValue("00:00:01")
ActiveSheet.PasteSpecial Format:="Bitmap", Link:=False,
DisplayAsIcon:=False
ActiveSheet.Range("A1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
ActiveWorkbook.Close False
Unload Me
End Sub


However, this is simply a screenshot and I can't seem to figure out
how to size it down (even with fooling with the numbers). Are there
any calculated or more exact resizing methods? Or maybe more
parameters I could include?


Thank you very much


-Andrew


--

Dave Peterson


Sorry for my silly typo. It's 5 by 8 inches. Although a wall poster
of a bitmap image of my userform might be nice.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Resizing and Printing a UserForm

On Apr 17, 5:46 pm, Dave Peterson wrote:
5 feet by 8 feet?????????? <vbg

Since you're only printing a worksheet, maybe you could just do the equivalent
of File|Page setup|Page Tab|Adjust to %.

Add a line like:

ActiveSheet.PageSetup.Zoom = 70
Before the .Printout command

In fact, you could experiment by commenting these lines:

' ActiveWindow.SelectedSheets.PrintOut Copies:=1
' ActiveWorkbook.Close False

Then when the code stops, you could resize it manually to make it fit the way
you want. Then modify the code to use that percentage.



wrote:

Hi,
I have a UserForm that I needed to print out on a 5'x8' sheet.
Currently I have (thanks to this forum)


Public Const VK_SNAPSHOT = 44
Public Const VK_LMENU = 164
Public Const KEYEVENTF_KEYUP = 2
Public Const KEYEVENTF_EXTENDEDKEY = 1
Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As
Long)
sub main()
'deleted code
UserForm1.show
End Sub


Private Sub print_form_Click()
DoEvents
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY + _
KEYEVENTF_KEYUP, 0
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY + _
KEYEVENTF_KEYUP, 0
DoEvents
Workbooks.Add
Application.Wait Now + TimeValue("00:00:01")
ActiveSheet.PasteSpecial Format:="Bitmap", Link:=False,
DisplayAsIcon:=False
ActiveSheet.Range("A1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
ActiveWorkbook.Close False
Unload Me
End Sub


However, this is simply a screenshot and I can't seem to figure out
how to size it down (even with fooling with the numbers). Are there
any calculated or more exact resizing methods? Or maybe more
parameters I could include?


Thank you very much


-Andrew


--

Dave Peterson


Here's how I finished right before the print function (as an exact
size)
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = 360#
Selection.ShapeRange.width = 576#

That ends up being exactly 5"x8"

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
auto-resizing UserForm window NickHK Excel Programming 2 January 11th 07 08:02 AM
auto-resizing UserForm window John Bundy Excel Programming 0 January 10th 07 05:15 PM
resizing listbox columns in excel userform u9946675 Excel Programming 1 November 3rd 06 03:43 PM
Resizing Userform to screen size Al@n Excel Programming 2 January 15th 06 09:26 PM
Userform resizing lmarks Excel Programming 5 August 4th 04 06:56 PM


All times are GMT +1. The time now is 08:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"