ActiveX controls and printing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I’m using a form with an ActiveX control (Autodesk’s DWG TrueView) to view
AutoCAD drawings. I can print the drawings directly from my database by
right clicking on the ActiveX control, then selecting File – Plot. This
opens TrueView’s “print dialog†(not sure if that’s the correct term) so that
I can select the printer, paper size, and plot area. Is there a way to
automate this so I can just click a command button?

If someone could point me in the right direction I’d really appreciate it.

Thanks.
 
Your control exposes a method, probably named Plot. You can easily see what
Methods and Properties the control exposes.
Open any code module.
Right click anywhere in the code window and select Object Browser.
In the Topmost left Combo control which currently shows <All Libraries>
select your ActiveX control's library.

Now you can see all of the components of the library and how to read/write
the Properties and call the Methods of the specific class.

Place code behind your CommandButton like:

Me.NameOfYourActiveXControl.Plot ProbablyAParameterForTheMethodHere

If you are still having trouble, from the Object Browser window copy and
paste the Plot method declaration.
For example, here is the VBA lib MsgBox function.

Function MsgBox(Prompt, [Buttons As VbMsgBoxStyle = vbOKOnly], [Title],
[HelpFile], [Context]) As VbMsgBoxResult
Member of VBA.Interaction



--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top