VBA duplicate PDF file -


i need help. need vba function make copies of single pdf file. example file reference/name 1, need amount x of copies lets 1 10. in order avoid coping , paste 9 times , renaming them manually sure there must function job. basic vba appreciated.

many

first need add reference microsoft scripting runtime in vba editor. following work...

public sub test()     copyfile "c:\users\randrews\desktop\1.gif", "c:\users\randrews\desktop", 10 end sub  public sub copyfile(originalpath string, destinationfolderpath, copies integer)  dim fs new filesystemobject  = 1 copies     origname = fs.getfilename(originalpath) 'file name extention e.g. 1.gif     orignumber = cint(left(origname, len(origname) - 4)) 'file name converted number - crash if file name contains non numeric chars     destname = orignumber + & "." & fs.getextensionname(originalpath) 'new file name = original number + + file extension     fs.copyfile originalpath, destinationfolderpath & "\" & destname next  end sub 

Comments

Popular posts from this blog

How to logout from a login page in asp.net -

Stack level too deep error after upgrade to rails 3.2 and ruby 1.9.3 -