调试MODI vbsscript [英] debug MODI vbsscript
问题描述
美好的一天,
在下面的代码中,我试图从多页tif图像中保存单页,这是基于图像本身的数字。
in the code below, im trying to save single pages from a multi-paged tif image, this based on a number that's in the image itself.
我首先在VBA中创建了代码,并且它按预期工作。
i made the code in VBA first, and that worked as it should.
然而,用于触发代码的应用程序在执行后开始滞后,所以我喜欢在VBS的单独线程中执行代码。
however the application i used to fire the code starts lagging after execution, so i like to execute the code in a seperate thread with VBS.
我得到的就是这个。
sub ocr_omzetten()
dim imageCounter
dim strRecText
dim lpkbloc
dim sPkbNummer
Set doc1 = CreateObject("MODI.Document")
Set doc2 = CreateObject("MODI.Document")
doc1.Create ("z:\test.tif")
doc1.Ocr
For imageCounter = 0 To (doc1.Images.Count - 1)
strRecText = doc1.Images(imageCounter).Layout.Text
lpkbloc = InStr(1, strRecText, "Pkb:")
If lpkbloc <> 0 Then
sPkbNummer = Mid(strRecText, lpkbloc + 5, 7)
doc2.Create
doc2.Images.Add doc1.Images(imageCounter), Nothing
doc2.SaveAs "Z:\signedDOC\" & sPkbNummer & ".tif", 1, 2
doc2.Close
End If
Next
doc1.Close
Set doc1 = Nothing
Set doc2 = Nothing
end sub
也许我只是做错了,因为这将是我的第一个VBS,我在这台计算机上没有IDE。
perhaps i'm just doing it all wrong, because this would be my first VBS and i lack a IDE at this computer.
任何可以调试的人?
当我执行时我没有获取任何错误消息,但它不会输出任何内容
when i execute i don't get any error messages, but it doesn't output anything neither
推荐答案
您的代码包含永远不会被调用的子程序。摆脱第一行和最后一行将使其运行。是否会做正确的事我没有检查。
Your code consists of a subroutine that never gets invoked. Getting rid of the very first and the very last line will make it run. Whether it will do the right thing I did not check.
这篇关于调试MODI vbsscript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!