ActiveX controls and printing

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.
 
S

Stephen Lebans

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top