ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/learning/Summation_COM.py
Revision: 8
Committed: Sat May 5 04:21:19 2012 UTC (13 years, 10 months ago) by ninoborges
Content type: text/x-python
File size: 1499 byte(s)
Log Message:
Initial Import

File Contents

# User Rev Content
1 ninoborges 8 ## Summation_COM.py
2     ## I can not find Summation.Application in the makePY list, So this file will contain the functions and examples
3     ## I come up with for using Summation's COM
4     ## EBorges
5     ## 4.14.04
6    
7     from win32com.client import Dispatch
8     from win32com.client import constants
9    
10     SWObj = Dispatch("summation.Application")
11    
12    
13     ## Testing Adding an entry and then a tiff to an existing summary in the imginfo
14     #>>> SWObj.Img.AddDoc("SN00481","@I",1,"")
15     #1
16     #>>> SWObj.Img.AddPage("SN00481","1.tif")
17     #1
18    
19     ## Adding an OCR to an existing Summary
20     #SWObj.ocrBase.AddOCRDocument("SN00481","C:\\test_dir\\1.txt")
21     #this next line is kinda buggy...
22     #SWObj.Utility.Blaze
23    
24     ## Doing an easy search
25     #SWObj.DB.DBSearch("Begdoc# contains SN*")
26    
27    
28     ## Printing all the info in the Summary column IN THE SELECTED FORM. (the curent open form)
29     def GetSummary():
30     #varSummary = SWObj.db.Fields("Summary").Value
31     #varSummary = SWObj.db.Fields("Imgfiles").Value
32     varSummary = SWObj.db.Fields("Recip").Value
33     return varSummary
34    
35     if __name__ == "__main__":
36     numberOfRows = SWObj.db.recordcount
37     SWObj.db.MoveFirst()
38     while numberOfRows > 0:
39     summary = GetSummary()
40     print numberOfRows
41     print summary
42     #SWObj.db.MoveLast()
43     SWObj.db.MoveNext()
44     numberOfRows = numberOfRows - 1
45    
46     ## This is how you update the property.
47     #>>> test = SWObj.db.Fields("Doctype").Value = "SECS Filing"
48     # >>> SWObj.db.Update(
49