|
import part custom property into msword
is there a simple way to import a sw custom property into msword? for example, import a part's "description" property value into a word document. non-programmer here. tia.
marc
here is the vba code.
sub macro1()
dim swapp as sldworks.sldworks
dim swmodel as sldworks.modeldoc2
set swapp = createobject("sldworks.application")
set swmodel = swapp.activedoc
selection.typetext text:=(swmodel.getcustominfovalue("", "description"))
set swmodel = nothing
set swapp = nothing
end sub
i have attached a word .doc for you. you must set the reference to the solidworks 200x (replace the x with your version) type library in the vba editor. i am not sure if this will carry over in the document i put together. once the vba editor is open, tools>references. check the corresponding box. you can then save the macro. from the visual basic toolbar, hit the play button and choose macro1. this will import your "description" custom property to your current cursor position.
make sure that you have a part, assembly, or drawing open before you run this.
tony szuta
cswa, cswp, cswp-smtl
intel core2 quad (q6600 @ 2.40 ghz)
nvidia quadro fx 4600 sdi
solidworks 2008 sp 4.0 (x32 & x64)
solidworks 2009 sp 2.0 (x32 & x64)
edited: 09/05/2008 at 05:21 pm by tony szuta
quick |
|