<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/print-screen-from-vba/m-p/341625#M82748</link>
    <description>the code doesn't work in VBA but I will take a look to see if I can modify&lt;BR /&gt;
to work.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for the info.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Rob Starz&lt;BR /&gt;
Plogv 3.0 &amp;amp; 2000 (plot logging) for r14 &amp;amp; 2000&lt;BR /&gt;
***Enhancement Tools for Arch. Desktop *****&lt;BR /&gt;
*** ADTcadPacX³ coming soon  ****&lt;BR /&gt;
http://www.stardsign.com/main.htm&lt;BR /&gt;
StarDsign cad solution</description>
    <pubDate>Tue, 10 Jul 2001 11:45:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2001-07-10T11:45:28Z</dc:date>
    <item>
      <title>Print Screen From VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/print-screen-from-vba/m-p/341623#M82746</link>
      <description>I was curious to see if there is a way from VBA to do Print Screen like&lt;BR /&gt;
Alt+Print Screen.&lt;BR /&gt;
&lt;BR /&gt;
Is there a way.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Rob Starz&lt;BR /&gt;
Plogv 3.0 &amp;amp; 2000 (plot logging) for r14 &amp;amp; 2000&lt;BR /&gt;
***Enhancement Tools for Arch. Desktop *****&lt;BR /&gt;
*** ADTcadPacX³ coming soon  ****&lt;BR /&gt;
http://www.stardsign.com/main.htm&lt;BR /&gt;
StarDsign cad solution</description>
      <pubDate>Tue, 10 Jul 2001 08:49:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/print-screen-from-vba/m-p/341623#M82746</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-07-10T08:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Print Screen From VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/print-screen-from-vba/m-p/341624#M82747</link>
      <description>Rob,&lt;BR /&gt;
&lt;BR /&gt;
The following works in a VB project. I haven't tried it in VBA, but maybe it&lt;BR /&gt;
can get you close to what you are after. Paste the attached code in a module&lt;BR /&gt;
and create a form named form1. Then create a sub to call the GetWindowBitMap&lt;BR /&gt;
subr. It should capture the active window.&lt;BR /&gt;
&lt;BR /&gt;
Good luck,&lt;BR /&gt;
Wayne&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Option Explicit&lt;BR /&gt;
&lt;BR /&gt;
'Declare API to get a copy of entire screen&lt;BR /&gt;
Public Declare Function BitBlt _&lt;BR /&gt;
Lib "gdi32" ( _&lt;BR /&gt;
    ByVal hDestDC As Long, _&lt;BR /&gt;
    ByVal lngX As Long, ByVal lngY As Long, _&lt;BR /&gt;
    ByVal nWidth As Long, _&lt;BR /&gt;
    ByVal nHeight As Long, _&lt;BR /&gt;
    ByVal hSrcDC As Long, _&lt;BR /&gt;
    ByVal lngXSrc As Long, ByVal lngYSrc As Long, _&lt;BR /&gt;
    ByVal dwRop As Long _&lt;BR /&gt;
) As Long&lt;BR /&gt;
&lt;BR /&gt;
'Declare API to get handle to screen&lt;BR /&gt;
Public Declare Function GetDesktopWindow _&lt;BR /&gt;
Lib "user32" () As Long&lt;BR /&gt;
&lt;BR /&gt;
'Declare API to convert handle to device context&lt;BR /&gt;
Public Declare Function GetDC _&lt;BR /&gt;
Lib "user32" ( _&lt;BR /&gt;
    ByVal hwnd As Long _&lt;BR /&gt;
) As Long&lt;BR /&gt;
&lt;BR /&gt;
'Declare API to release device context&lt;BR /&gt;
Public Declare Function ReleaseDC _&lt;BR /&gt;
Lib "user32" ( _&lt;BR /&gt;
    ByVal hwnd As Long, _&lt;BR /&gt;
    ByVal hdc As Long _&lt;BR /&gt;
) As Long&lt;BR /&gt;
&lt;BR /&gt;
'Declare API to get handle to the active window&lt;BR /&gt;
Public Declare Function GetActiveWindow Lib "user32" () As Long&lt;BR /&gt;
&lt;BR /&gt;
'Declare API to get boundries of the active window&lt;BR /&gt;
Public Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long,&lt;BR /&gt;
lpRect As RECT) As Long&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Type RECT&lt;BR /&gt;
        Left As Long&lt;BR /&gt;
        Top As Long&lt;BR /&gt;
        Right As Long&lt;BR /&gt;
        Bottom As Long&lt;BR /&gt;
End Type&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Public Sub GetWindowBitMap()&lt;BR /&gt;
    Dim lngX As Long&lt;BR /&gt;
    Dim lngY As Long&lt;BR /&gt;
    Dim lngXSrc As Long&lt;BR /&gt;
    Dim lngYSrc As Long&lt;BR /&gt;
    Dim dwRop As Long&lt;BR /&gt;
    Dim hwndSrc As Long&lt;BR /&gt;
    Dim hSrcDC As Long&lt;BR /&gt;
    Dim lngRes As Long&lt;BR /&gt;
    Dim lngM1 As Long&lt;BR /&gt;
    Dim lngM2 As Long&lt;BR /&gt;
    Dim lngN1 As Long&lt;BR /&gt;
    Dim lngN2 As Long&lt;BR /&gt;
    Dim lngPixelColor As Long&lt;BR /&gt;
    Dim lngPixelCount As Long&lt;BR /&gt;
    Dim lngRet As Long&lt;BR /&gt;
    Dim intPowerOfTwo As Integer&lt;BR /&gt;
&lt;BR /&gt;
    Dim recWindow As RECT&lt;BR /&gt;
    Dim TwipsPerPixelX As Single&lt;BR /&gt;
    Dim TwipsPerPixelY As Single&lt;BR /&gt;
    Dim NumPixX As Single&lt;BR /&gt;
    Dim NumPixY As Single&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
    Form1.ScaleMode = vbPixels '3&lt;BR /&gt;
    dwRop = &amp;amp;HCC0020&lt;BR /&gt;
&lt;BR /&gt;
    hwndSrc = GetActiveWindow&lt;BR /&gt;
&lt;BR /&gt;
  ' Get the rectangle describing the window&lt;BR /&gt;
  GetWindowRect hwndSrc, recWindow&lt;BR /&gt;
  'Set the values to translate the window from Pixels to Twips&lt;BR /&gt;
  NumPixX = Form1.ScaleWidth&lt;BR /&gt;
  NumPixY = Form1.ScaleHeight&lt;BR /&gt;
  'Set the ScaleMode to Twips&lt;BR /&gt;
  Form1.ScaleMode = 1&lt;BR /&gt;
  TwipsPerPixelX = Form1.ScaleWidth / NumPixX&lt;BR /&gt;
  TwipsPerPixelY = Form1.ScaleHeight / NumPixY&lt;BR /&gt;
  'Set the ScaleMode back to Pixels&lt;BR /&gt;
  Form1.ScaleMode = vbPixels '3&lt;BR /&gt;
  'Change the form size to the size of the Active Window&lt;BR /&gt;
  Form1.Move recWindow.Left * TwipsPerPixelX, _&lt;BR /&gt;
             recWindow.Top * TwipsPerPixelY, _&lt;BR /&gt;
            (recWindow.Right - recWindow.Left) * TwipsPerPixelX, _&lt;BR /&gt;
            (recWindow.Bottom - recWindow.Top) * TwipsPerPixelY&lt;BR /&gt;
  hSrcDC = GetDC(hwndSrc)&lt;BR /&gt;
  'Create the bitmap&lt;BR /&gt;
  lngRes = BitBlt(Form1.hdc, 0, 0, Form1.ScaleWidth, _&lt;BR /&gt;
  Form1.ScaleHeight, hSrcDC, 0, 0, dwRop)&lt;BR /&gt;
  'Release the Hardware Device Context to the Active Window&lt;BR /&gt;
  'Windows could hang if this is not done&lt;BR /&gt;
  lngRes = ReleaseDC(hwndSrc, hSrcDC)&lt;BR /&gt;
  'Display full size&lt;BR /&gt;
  Form1.Show&lt;BR /&gt;
  'Clear the clipboard&lt;BR /&gt;
  Clipboard.Clear&lt;BR /&gt;
  'Copy fhe form image to the clipboard&lt;BR /&gt;
  Clipboard.SetData Form1.Image, vbCFBitmap&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Rob Starz" &lt;ROB&gt; wrote in message&lt;BR /&gt;
news:78E9190D508C8600499606E63AF0C4CB@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; I was curious to see if there is a way from VBA to do Print Screen like&lt;BR /&gt;
&amp;gt; Alt+Print Screen.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Is there a way.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Rob Starz&lt;BR /&gt;
&amp;gt; Plogv 3.0 &amp;amp; 2000 (plot logging) for r14 &amp;amp; 2000&lt;BR /&gt;
&amp;gt; ***Enhancement Tools for Arch. Desktop *****&lt;BR /&gt;
&amp;gt; *** ADTcadPacX³ coming soon  ****&lt;BR /&gt;
&amp;gt; http://www.stardsign.com/main.htm&lt;BR /&gt;
&amp;gt; StarDsign cad solution&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/ROB&gt;</description>
      <pubDate>Tue, 10 Jul 2001 11:20:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/print-screen-from-vba/m-p/341624#M82747</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-07-10T11:20:38Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/print-screen-from-vba/m-p/341625#M82748</link>
      <description>the code doesn't work in VBA but I will take a look to see if I can modify&lt;BR /&gt;
to work.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for the info.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Rob Starz&lt;BR /&gt;
Plogv 3.0 &amp;amp; 2000 (plot logging) for r14 &amp;amp; 2000&lt;BR /&gt;
***Enhancement Tools for Arch. Desktop *****&lt;BR /&gt;
*** ADTcadPacX³ coming soon  ****&lt;BR /&gt;
http://www.stardsign.com/main.htm&lt;BR /&gt;
StarDsign cad solution</description>
      <pubDate>Tue, 10 Jul 2001 11:45:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/print-screen-from-vba/m-p/341625#M82748</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-07-10T11:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Print Screen From VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/print-screen-from-vba/m-p/341626#M82749</link>
      <description>I usually just do Alt+Print Screen, which copies the active window bitmap to&lt;BR /&gt;
the clipboard, then paste it into Paint or Word, and then print from there.&lt;BR /&gt;
--&lt;BR /&gt;
John Goodfellow&lt;BR /&gt;
irtf'nm&lt;BR /&gt;
use 'microtouch' in address to email&lt;BR /&gt;
&lt;BR /&gt;
"Rob Starz" &lt;ROB&gt; wrote in message&lt;BR /&gt;
news:78E9190D508C8600499606E63AF0C4CB@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; I was curious to see if there is a way from VBA to do Print Screen like&lt;BR /&gt;
&amp;gt; Alt+Print Screen.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Is there a way.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Rob Starz&lt;BR /&gt;
&amp;gt; Plogv 3.0 &amp;amp; 2000 (plot logging) for r14 &amp;amp; 2000&lt;BR /&gt;
&amp;gt; ***Enhancement Tools for Arch. Desktop *****&lt;BR /&gt;
&amp;gt; *** ADTcadPacX³ coming soon  ****&lt;BR /&gt;
&amp;gt; http://www.stardsign.com/main.htm&lt;BR /&gt;
&amp;gt; StarDsign cad solution&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/ROB&gt;</description>
      <pubDate>Tue, 10 Jul 2001 12:31:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/print-screen-from-vba/m-p/341626#M82749</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-07-10T12:31:50Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/print-screen-from-vba/m-p/341627#M82750</link>
      <description>I was trying to see if can make this easier and do a print screen and then&lt;BR /&gt;
paste to PhotoPaint, save and Image the file in.    It was just something&lt;BR /&gt;
that went through my head and was curious as to the possiblity&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Rob Starz&lt;BR /&gt;
Plogv 3.0 &amp;amp; 2000 (plot logging) for r14 &amp;amp; 2000&lt;BR /&gt;
***Enhancement Tools for Arch. Desktop *****&lt;BR /&gt;
*** ADTcadPacX³ coming soon  ****&lt;BR /&gt;
http://www.stardsign.com/main.htm&lt;BR /&gt;
StarDsign cad solution</description>
      <pubDate>Tue, 10 Jul 2001 12:40:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/print-screen-from-vba/m-p/341627#M82750</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-07-10T12:40:55Z</dc:date>
    </item>
  </channel>
</rss>

