java - Have to use a thread sleep procedure to get document updated -


i have word macro needs run using java. use vb script run macro below. editing in word document , use "test.doc" read inputstream. have sleep main thread while document changes in "test.doc" file (varies time needed thread sleep time document document). shown in code. bit confused because wait process end. , still document not updated? can please me here?

process proc = runtime.getruntime().exec("cmd /c start c:\\test.vbs"); proc.waitfor(); thread.currentthread().sleep(2000); inputstream uploadedfilestream = new bufferedinputstream(new fileinputstream("c:\\test.doc")); 

get rid of "start", created instance of word doesn't run in background, , sleep unnecessary.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -