First experince.
I need to show in form the attached word doc, but visualize it, at a zoom of 70%, not 100%...
I need to show in form the attached word doc, but visualize it, at a zoom of 70%, not 100%...
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[COLOR=blue]Option Explicit
Private myscale As Single
Private Sub Form_Load()
OLE1.SizeMode = vbOLESizeAutoSize [COLOR=green]' ensures we have an enhanced metafile picture in the OLE container[/color]
OLE1.CreateEmbed "f:\testing.docx", "Word.application" [COLOR=green]' Here is where we load our word doc[/color]
OLEZoom = 75 [COLOR=green]' initial zoom %[/color]
End Sub
Private Sub OLEZoom_Change()
Label1.Caption = Format(OLEZoom / 100, "0%")
DrawOLEView
End Sub
Public Sub DrawOLEView()
myscale = OLEZoom / 100
OLEProxieView.Width = OLE1.Picture.Width * ScaleX(1, 8, 1) * myscale
OLEProxieView.Height = OLE1.Picture.Height * ScaleY(1, 8, 1) * myscale
OLEProxieView.AutoRedraw = True
OLEProxieView.Cls
[COLOR=green]' This is the line that does all the hard work[/color]
OLE1.Picture.Render OLEProxieView.hDC, 0, 0, OLE1.Picture.Width * ScaleX(1, 8, 3) * myscale, OLE1.Picture.Height * ScaleY(1, 8, 3) * myscale, 0, OLE1.Picture.Height, OLE1.Picture.Width, -OLE1.Picture.Height, 0&
OLEProxieView.AutoRedraw = False
OLEProxieView.Refresh
End Sub[/color]