查看单个帖子
旧 2009-04-13, 09:55 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】copy properties to pdf file

copy properties to pdf file?
i'm trying to write a simple macros that we can create a pdf of a drawing that copies some of the file properties into the pdf.
the current pdf macro we use saves it as "filename"_rev_"revision".pdf and is sent to the appropriate directory. we then manually have to move the older rev out and into the archive folder
since we are in the process of implementing enterprise i found out we could keep it as one file now so we don't confuse purchasing with more than one rev in the folder (i'm guilty of that!). they don't care about which is the latest, just as long as they get it and we don't have to move files. the only thing is i'd like it to copy over the revision property for now (from there i should be able to do the rest).
what do i need to add? this is the current code (i still need to remove the rev part in the filename)
dim swapp, model as object
dim modname, newname, rev, fname as string
sub main()
set swapp = createobject("sldworks.application")
set model = swapp.activedoc
modname = model.gettitle
modname = left(modname, instr(1, modname, " ") - 1)
rev = model.custominfo("revision")
fname = modname + "_rev" + rev
pdf = "p:\pdm\02 - released\" + fname + ".pdf"
model.saveas2 pdf, 0, true, false
end sub
(btw, i'm just getting into this macro stuff...still waiting for a course to come up)
thanks,
jeff
find and install the dsofile library on ms's website. it can write custom properties.
quick
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)