Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving Userform as Gif

Hi,

Anyone got any ideas on how to save a userform through VBA as a gif? Found
plenty on saving a chart as a gif, but can't figure out how to do the same
with a userform.

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Saving Userform as Gif

Robert wrote:

Hi,

Anyone got any ideas on how to save a userform through VBA as a gif?
Found plenty on saving a chart as a gif, but can't figure out how to
do the same with a userform.

Thanks


I don't want to sound silly, but... how about taking a screenshot?
Using PrtSc, one of the grey keys on the top of your keyboard you
almost never use. And then you paste it in your favorite image editing
software.
Or use image editing software to take screenshots. I use Paint Shop Pro
a lot for taking screenshots of forms, because it gives me the
possibility to capture only a single screen object and not the entire
screen.

PS: I write a lot of user manuals at work, with *a lot* of screenshots
and examples.

--
Amedee Van Gasse

To top-post is human, to bottom-post and snip is sublime.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Saving Userform as Gif



Doing PrintScreen with code...

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

Private Const KEYEVENTF_KEYUP = &H2
Private Const VK_SNAPSHOT = &H2C
Private Const VK_MENU = &H12

Sub AltPrintScreen()
keybd_event VK_MENU, 0, 0, 0
keybd_event VK_SNAPSHOT, 0, 0, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_KEYUP, 0
keybd_event VK_MENU, 0, KEYEVENTF_KEYUP, 0
End Sub

Saving it from the clipbooard is en entirely different matter
good luck :)


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Amedee Van Gasse wrote :

Robert wrote:

Hi,

Anyone got any ideas on how to save a userform through VBA as a gif?
Found plenty on saving a chart as a gif, but can't figure out how to
do the same with a userform.

Thanks


I don't want to sound silly, but... how about taking a screenshot?
Using PrtSc, one of the grey keys on the top of your keyboard you
almost never use. And then you paste it in your favorite image editing
software.
Or use image editing software to take screenshots. I use Paint Shop
Pro a lot for taking screenshots of forms, because it gives me the
possibility to capture only a single screen object and not the entire
screen.

PS: I write a lot of user manuals at work, with *a lot* of screenshots
and examples.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Saving Userform as Gif

With Alt-Print Scrn you only capture the userform when it is active
Paste it in Paint and save it

If you want to have a program for this buy Snagit
http://www.techsmith.com/default.asp


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Amedee Van Gasse" wrote in message ...
Robert wrote:

Hi,

Anyone got any ideas on how to save a userform through VBA as a gif?
Found plenty on saving a chart as a gif, but can't figure out how to
do the same with a userform.

Thanks


I don't want to sound silly, but... how about taking a screenshot?
Using PrtSc, one of the grey keys on the top of your keyboard you
almost never use. And then you paste it in your favorite image editing
software.
Or use image editing software to take screenshots. I use Paint Shop Pro
a lot for taking screenshots of forms, because it gives me the
possibility to capture only a single screen object and not the entire
screen.

PS: I write a lot of user manuals at work, with *a lot* of screenshots
and examples.

--
Amedee Van Gasse

To top-post is human, to bottom-post and snip is sublime.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Saving Userform as Gif

"Robert" wrote in message ...
Hi,

Anyone got any ideas on how to save a userform through VBA as a gif? Found
plenty on saving a chart as a gif, but can't figure out how to do the same
with a userform.

Thanks



There are a number of ways to do this....

1. From my good friend Colo

Works off UserForm_DblClick routine

Option Explicit

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

Private Const VK_LMENU = &HA4
Private Const VK_SNAPSHOT = &H2C
Private Const VK_CONTROL = &H11
Private Const VK_V = &H56
Private Const VK_0x79 = &H79
Private Const KEYEVENTF_EXTENDEDKEY = &H1
Private Const KEYEVENTF_KEYUP = &H2



Private Sub UserForm_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim sAppOs As String
Dim wks As Worksheet
'get oparating system
sAppOs = Application.OperatingSystem

Application.DisplayAlerts = False
Application.ScreenUpdating = False

If Mid(sAppOs, 18, 2) = "NT" Then
' WinNT,Windows2000,WindowsXP - Using Win32API
Call keybd_event(VK_LMENU, VK_V, KEYEVENTF_EXTENDEDKEY, 0)
Call keybd_event(VK_SNAPSHOT, VK_0x79, KEYEVENTF_EXTENDEDKEY,
0)
Call keybd_event(VK_LMENU, VK_V, KEYEVENTF_EXTENDEDKEY Or
KEYEVENTF_KEYUP, 0)
Call keybd_event(VK_SNAPSHOT, VK_0x79, KEYEVENTF_EXTENDEDKEY
Or KEYEVENTF_KEYUP, 0)
Else
' Windows95,Windows98,WindowsME
Call keybd_event(VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0)
Call keybd_event(VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY Or
KEYEVENTF_KEYUP, 0)
End If
DoEvents
Unload Me
Set wks = Workbooks.Add.Sheets(1)
Application.Goto wks.Range("A1")
ActiveSheet.Paste
wks.SaveAs Filename:="C:\myfile.htm", FileFormat:=xlHtml
wks.Parent.Close False

Application.ScreenUpdating = True
Application.DisplayAlerts = True
MsgBox "Have a look at C:\myfile.files folder."
End Sub


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving Userform as Gif

Thanks Ivan,

That worked great, with a little extra code it did exactly what I
needed.

Rob



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving Userform as Gif

Robert...any chance I can get your end result code for the userform as gif via screenshot?

Thanks
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Saving Userform as Gif

Robert...any chance I can get your end result code for the userform
as gif via screenshot?

Thanks


Well I searched back about 1 year of posts and did not find a subject
as what's to the right of "" in your subject line so can you post
the date of the original thread?

<FWIW
I use Paint Shop Pro for this, and find it works really well. I prefer
to save the images as GIFs because I insert them into the CHMs I use
for UserGuides. This also serves well for images used on websites
and/or HTML-based ebooks.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


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
Automaticly saving formula's to values when saving Gunti Excel Discussion (Misc queries) 8 November 11th 08 09:34 AM
Userform nath Excel Programming 1 May 25th 04 03:06 PM
Userform inside another userform Ryan Excel Programming 0 April 23rd 04 08:01 PM
Saving a Workbook: Forcing User to Rename before Saving Rollin_Again[_6_] Excel Programming 5 April 16th 04 02:54 PM
Userform Silsila Excel Programming 6 April 5th 04 02:47 PM


All times are GMT +1. The time now is 09:22 PM.

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"