Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 03-28-2013, 05:32 PM
AlexR AlexR is offline Show userform without losing document focus? Or other method to get a graphic to pop? Windows XP Show userform without losing document focus? Or other method to get a graphic to pop? Office 2007
Novice
Show userform without losing document focus? Or other method to get a graphic to pop?
 
Join Date: Mar 2013
Location: Eastern PA, USA
Posts: 8
AlexR is on a distinguished road
Default

Ah, thank you!! I combined your answer with some code I found elsewhere for a perfect result!

I'm using this to automatically close the Userform:

Code:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) 
 
Private Sub UserForm_Activate() 
    DoEvents 
    Sleep 500 
    Unload Me 
End Sub
(Source: http://www.ozgrid.com/forum/showthread.php?p=506767)


I also came up with this, to close the form with any keystroke and return the character, but I'm still getting some wonky results with non-alphanumeric keys. Your way works better, but just in case this might be useful to someone else:
Code:
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    If Shift = 0 Then Selection.TypeText LCase(Chr(KeyCode))
    If Shift = 1 Then Selection.TypeText Chr(KeyCode)
    Unload Me
End Sub
Reply With Quote
 

Tags
document focus, graphics, userform



Similar Threads
Thread Thread Starter Forum Replies Last Post
Show userform without losing document focus? Or other method to get a graphic to pop? Losing charts in Word document sweetpotater Word 1 04-24-2012 04:46 AM
Show userform without losing document focus? Or other method to get a graphic to pop? How to link userform to another word document SaneMan Word VBA 5 10-14-2011 05:12 AM
Show userform without losing document focus? Or other method to get a graphic to pop? Setting focus to specific word document from UserForm SaneMan Word VBA 5 04-01-2011 03:11 PM
I have a Word 2007 document that only show 13 pages xeonix Word 0 07-06-2009 08:38 PM
Show userform without losing document focus? Or other method to get a graphic to pop? Graphic files do not appear in my document plt Drawing and Graphics 2 04-22-2009 09:58 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:32 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft