- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have found some posts regarding the capture views directly to the clip board. What I need to do is to capture the active view (I will have show in the active view what I need: maps, geometry, ...). The code I am trying is the following, but it only captures the general view of the structure, not the active window.
I would appreciate some help.
Regards.
Sub capturaimagenRobot()
' définition d'une vue
Set RobApp = New RobotApplication
RobApp.Interactive = True
RobApp.Visible = True
RobApp.Window.Activate
Dim mavueRobot As IRobotView3 ' this is important to set IRobotView3 if you want to make screen capture of this view
Set mavueRobot = RobApp.Project.ViewMngr.GetView(1) ' it seems CreateView makes this strange affect, use GetView instead
Dim ScPar As RobotViewScreenCaptureParams
Set ScPar = RobApp.CmpntFactory.Create(I_CT_VIEW_SCREEN_CAPTURE_PARAMS)
'ScPar.Name = "Screen capture"
ScPar.UpdateType = I_SCUT_COPY_TO_CLIPBOARD
ScPar.Resolution = I_VSCR_2048
mavueRobot.MakeScreenCapture ScPar
ActiveCell.Select
ActiveSheet.Paste
election.ShapeRange.ScaleWidth 0.36, msoFalse, msoScaleFromTopLeft
End Sub
Solved! Go to Solution.