Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default print userform (for MVA)

Hi,
I'd like print userform and setting (enlarge) leftmargin.
Actually my printout is shift max to left and top.
Is there any solution in VBA (in module or class)?
i have code in body userform now:
Me.PrintForm
but printForm doesn't offer any options.
I find out snap a picture of the userform but how snap the
userform (only) without remain window???

I work in windows and excel 2000.

Any help will be apreciate.

Kind Regards
Mark

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default print userform (for MVA)

the code I provided does just take a picture of the userform alone. If you
then pasted it on a worksheet, you will need to manage where you put it,
what the worksheet looks like, and how you define the print area to achieve
your result. Printform alone offers no options.

But I have already told you this in you previous post.

--
Regards,
Tom Ogilvy



"Mark" wrote in message
...
Hi,
I'd like print userform and setting (enlarge) leftmargin.
Actually my printout is shift max to left and top.
Is there any solution in VBA (in module or class)?
i have code in body userform now:
Me.PrintForm
but printForm doesn't offer any options.
I find out snap a picture of the userform but how snap the
userform (only) without remain window???

I work in windows and excel 2000.

Any help will be apreciate.

Kind Regards
Mark



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default print userform (for MVA)

Hi Tom!
I know your reply, but I always answer you.
I enjoy you deal with my problem!
I don't know your code (api). I know a bit of VBA.
Actually thanks to You i have pasted whole window
(application and userform), and i'd like only userform. It
isn't dependent on printarea - image paste in worksheet by
your code is snapshot all display in my monitor.
If in snapshot is display all monitor (not olny userform)
how i set printarea autoamticly?
Still i can't snapshot only userform.

Can you resolve my problem or give me any tips?

I work in excel 2k and WIN 2000.

Best Regards
Mark

-----Original Message-----
the code I provided does just take a picture of the

userform alone. If you
then pasted it on a worksheet, you will need to manage

where you put it,
what the worksheet looks like, and how you define the

print area to achieve
your result. Printform alone offers no options.

But I have already told you this in you previous post.

--
Regards,
Tom Ogilvy



"Mark" wrote in message
...
Hi,
I'd like print userform and setting (enlarge)

leftmargin.
Actually my printout is shift max to left and top.
Is there any solution in VBA (in module or class)?
i have code in body userform now:
Me.PrintForm
but printForm doesn't offer any options.
I find out snap a picture of the userform but how snap

the
userform (only) without remain window???

I work in windows and excel 2000.

Any help will be apreciate.

Kind Regards
Mark



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default print userform (for MVA)

You are correct and I was wrong. Here is a version that will capture just
the userform:

Modification of code originally posted by
"Orlando Magalhães Filho"

Modified to capture just the userform (not the whole window).

In a general module:

Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

Public Const VK_SNAPSHOT = 44
Public Const VK_LMENU = 164
Public Const KEYEVENTF_KEYUP = 2
Public Const KEYEVENTF_EXTENDEDKEY = 1


Sub Test()
UserForm1.Show
End Sub


In the userform module:




Private Sub CommandButton1_Click()
' keybd_event VK_SNAPSHOT, 0, 0, 0
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
End Sub

--
Regards,
Tom Ogilvy

"Mark" wrote in message
...
Hi Tom!
I know your reply, but I always answer you.
I enjoy you deal with my problem!
I don't know your code (api). I know a bit of VBA.
Actually thanks to You i have pasted whole window
(application and userform), and i'd like only userform. It
isn't dependent on printarea - image paste in worksheet by
your code is snapshot all display in my monitor.
If in snapshot is display all monitor (not olny userform)
how i set printarea autoamticly?
Still i can't snapshot only userform.

Can you resolve my problem or give me any tips?

I work in excel 2k and WIN 2000.

Best Regards
Mark

-----Original Message-----
the code I provided does just take a picture of the

userform alone. If you
then pasted it on a worksheet, you will need to manage

where you put it,
what the worksheet looks like, and how you define the

print area to achieve
your result. Printform alone offers no options.

But I have already told you this in you previous post.

--
Regards,
Tom Ogilvy



"Mark" wrote in message
...
Hi,
I'd like print userform and setting (enlarge)

leftmargin.
Actually my printout is shift max to left and top.
Is there any solution in VBA (in module or class)?
i have code in body userform now:
Me.PrintForm
but printForm doesn't offer any options.
I find out snap a picture of the userform but how snap

the
userform (only) without remain window???

I work in windows and excel 2000.

Any help will be apreciate.

Kind Regards
Mark



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default print userform (for MVA)

Very well, very well.
Thanks Tom!

Best regards
Mark


-----Original Message-----
You are correct and I was wrong. Here is a version that

will capture just
the userform:

Modification of code originally posted by
"Orlando Magalhães Filho"

Modified to capture just the userform (not the whole

window).

In a general module:

Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
ByVal bScan As Byte, ByVal dwFlags As Long, ByVal

dwExtraInfo As Long)

Public Const VK_SNAPSHOT = 44
Public Const VK_LMENU = 164
Public Const KEYEVENTF_KEYUP = 2
Public Const KEYEVENTF_EXTENDEDKEY = 1


Sub Test()
UserForm1.Show
End Sub


In the userform module:




Private Sub CommandButton1_Click()
' keybd_event VK_SNAPSHOT, 0, 0, 0
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
End Sub

--
Regards,
Tom Ogilvy

"Mark" wrote in message
...
Hi Tom!
I know your reply, but I always answer you.
I enjoy you deal with my problem!
I don't know your code (api). I know a bit of VBA.
Actually thanks to You i have pasted whole window
(application and userform), and i'd like only userform.

It
isn't dependent on printarea - image paste in worksheet

by
your code is snapshot all display in my monitor.
If in snapshot is display all monitor (not olny

userform)
how i set printarea autoamticly?
Still i can't snapshot only userform.

Can you resolve my problem or give me any tips?

I work in excel 2k and WIN 2000.

Best Regards
Mark

-----Original Message-----
the code I provided does just take a picture of the

userform alone. If you
then pasted it on a worksheet, you will need to manage

where you put it,
what the worksheet looks like, and how you define the

print area to achieve
your result. Printform alone offers no options.

But I have already told you this in you previous post.

--
Regards,
Tom Ogilvy



"Mark" wrote in message
...
Hi,
I'd like print userform and setting (enlarge)

leftmargin.
Actually my printout is shift max to left and top.
Is there any solution in VBA (in module or class)?
i have code in body userform now:
Me.PrintForm
but printForm doesn't offer any options.
I find out snap a picture of the userform but how

snap
the
userform (only) without remain window???

I work in windows and excel 2000.

Any help will be apreciate.

Kind Regards
Mark



.



.



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
print userform and setting margin Mark[_17_] Excel Programming 5 August 3rd 04 03:50 PM
userform CheckBox print dok112[_12_] Excel Programming 1 June 21st 04 02:50 PM
userform CheckBox print dok112[_11_] Excel Programming 0 June 21st 04 08:41 AM
Userform Print Richard Excel Programming 3 June 8th 04 10:05 AM
UserForm: how to print it landscape Gabor Excel Programming 3 May 22nd 04 05:58 PM


All times are GMT +1. The time now is 01:06 AM.

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

About Us

"It's about Microsoft Excel"