Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Export UserForm Image for use in Microsoft Word

I have created a number of Excel User-forms for a tool I have developed in
Microsoft Excel. I would now like to export the images of these forms into a
Microsoft Word document intended to help users in the use of the Excel tool,
and have not been unable to work-out how to do this.

I can export the forms from the 'Visual Basic Editor', which produces two
files of type *.frm and *.frx. However, I have not been able to work-out how
to import these files into Word, if this is for that matter possible.

Could anyone advise me on the best way of exporting images of Excel User-
forms into a Word document?

--
Message posted via http://www.officekb.com
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Export UserForm Image for use in Microsoft Word

You could put a snapshot of it on a sheet, then copy that to the clipboard
and paste it into Word.

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

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

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 = &H2C

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 ' key down
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

As written, this is fired by a button on the form you are printing. You
could possibly change it to the Userform's click event and then just add it
temporarily to each form to get the picture.

--
Regards,
Tom Ogilvy


"Andy B via OfficeKB.com" <u5428@uwe wrote in message
news:5a804b68b52e6@uwe...
I have created a number of Excel User-forms for a tool I have developed in
Microsoft Excel. I would now like to export the images of these forms

into a
Microsoft Word document intended to help users in the use of the Excel

tool,
and have not been unable to work-out how to do this.

I can export the forms from the 'Visual Basic Editor', which produces two
files of type *.frm and *.frx. However, I have not been able to work-out

how
to import these files into Word, if this is for that matter possible.

Could anyone advise me on the best way of exporting images of Excel User-
forms into a Word document?

--
Message posted via http://www.officekb.com



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Export UserForm Image for use in Microsoft Word

The simplest option would be to use a screen capture program, run the
userform so it displays and capture it using something like Paint Shop Pro.
AFAIK you cannot do this from within Excel.

--
Cheers
Nigel



"Andy B via OfficeKB.com" <u5428@uwe wrote in message
news:5a804b68b52e6@uwe...
I have created a number of Excel User-forms for a tool I have developed in
Microsoft Excel. I would now like to export the images of these forms

into a
Microsoft Word document intended to help users in the use of the Excel

tool,
and have not been unable to work-out how to do this.

I can export the forms from the 'Visual Basic Editor', which produces two
files of type *.frm and *.frx. However, I have not been able to work-out

how
to import these files into Word, if this is for that matter possible.

Could anyone advise me on the best way of exporting images of Excel User-
forms into a Word document?

--
Message posted via http://www.officekb.com



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Export UserForm Image for use in Microsoft Word

Hi Andy,

I usually just write a simple UserForm1.Show macro, then use Alt-PrintScrn
to copy. Then just Paste into word.


"Andy B via OfficeKB.com" <u5428@uwe wrote in message
news:5a804b68b52e6@uwe...
I have created a number of Excel User-forms for a tool I have developed in
Microsoft Excel. I would now like to export the images of these forms
into a
Microsoft Word document intended to help users in the use of the Excel
tool,
and have not been unable to work-out how to do this.

I can export the forms from the 'Visual Basic Editor', which produces two
files of type *.frm and *.frx. However, I have not been able to work-out
how
to import these files into Word, if this is for that matter possible.

Could anyone advise me on the best way of exporting images of Excel User-
forms into a Word document?

--
Message posted via http://www.officekb.com



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
Export Org chart as image Steve G[_3_] Charts and Charting in Excel 6 May 27th 08 09:05 AM
Image Export - Org Chart Steve G[_2_] Excel Worksheet Functions 1 May 22nd 08 08:48 PM
Convert, export, or save Word as an image file (jpg, gif, png, etc quartz[_2_] Excel Programming 1 April 20th 05 04:20 PM
Export Chart to Microsoft Word leo_nunez Excel Programming 1 August 25th 04 10:45 PM
Export the worksheet background image as an image file - possible? DataFreakFromUtah Excel Programming 2 April 10th 04 04:49 PM


All times are GMT +1. The time now is 07:18 PM.

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"