Class: DocumentManager 1 COMOS Platform Class documentation DocumentManager_dll Programming Manual 03/2017 V10.2.1 A5E39863290-AA
Legal information Warning notice system This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are graded according to the degree of danger. DANGER indicates that death or severe personal injury will result if proper precautions are not taken. WARNING indicates that death or severe personal injury may result if proper precautions are not taken. CAUTION indicates that minor personal injury can result if proper precautions are not taken. NOTICE indicates that property damage can result if proper precautions are not taken. If more than one degree of danger is present, the warning notice representing the highest degree of danger will be used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to property damage. Qualified Personnel The product/system described in this documentation may be operated only by personnel qualified for the specific task in accordance with the relevant documentation, in particular its warning notices and safety instructions. Qualified personnel are those who, based on their training and experience, are capable of identifying risks and avoiding potential hazards when working with these products/systems. Proper use of Siemens products Note the following: Trademarks WARNING Siemens products may only be used for the applications described in the catalog and in the relevant technical documentation. If products and components from other manufacturers are used, these must be recommended or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and maintenance are required to ensure that the products operate safely and without any problems. The permissible ambient conditions must be complied with. The information in the relevant documentation must be observed. All names identified by are registered trademarks of Siemens AG. The remaining trademarks in this publication may be trademarks whose use by third parties for their own purposes could violate the rights of the owner. Disclaimer of Liability We have reviewed the contents of this publication to ensure consistency with the hardware and software described. Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the information in this publication is reviewed regularly and any necessary corrections are included in subsequent editions. Siemens AG Division Process Industries and Drives Postfach 48 48 90026 NÜRNBERG GERMANY A5E39863290-AA P 02/2017 Subject to change Copyright Siemens AG 2016-2017. All rights reserved
Table of contents 1 Class: DocumentManager...5 1.1 DocumentManager: Function...5 Programming Manual, 03/2017 V10.2.1, A5E39863290-AA 3
Table of contents 4 Programming Manual, 03/2017 V10.2.1, A5E39863290-AA
Class: DocumentManager 1 1.1 DocumentManager: Function ExportToEMF ExportToEMF(ByVal documents As Object) As Long Transfers the reports to the export interface for "emf". When the function is executed, the "Export to EMF" user interface opens. The settings in this user interface correspond to the following settings: Context menu of a report "Export > EMF". docmgr.exporttoemf a ExportToExcel ExportToExcel(ByVal documents As Object) As Long Transfers the reports to the export interface for Excel ("xls", "xlsx"). When the function is executed, the "Report to Excel" user interface opens. The settings in this user interface correspond to the following settings: Context menu of a report "Export > Excel". docmgr.exporttoexcel a ExportToWord ExportToWord(ByVal documents As Object) As Long Transfers the reports to the export interface for Word ("doc", "docx"). When the function is executed, the "Report to Word" user interface opens. The settings in this user interface correspond to the following settings: Context menu of a report "Export > Word". docmgr.exporttoword a Programming Manual, 03/2017 V10.2.1, A5E39863290-AA 5
Class: DocumentManager 1.1 DocumentManager: Function ExportToNTR ExportToNTR(ByVal documents As Object) As Long Transfers the reports to the export interface for ROHR2 ("ntr"). When the function is executed, the "Export to ROHR2" user interface opens. docmgr.exporttontr a SaveAsDxf SaveAsDxf(ByVal documents As Object) As Long Transfers the reports to the export interface for DXF and DWG. When the function is executed, the "Export to DWG/DXF" user interface opens. The settings in this user interface correspond to the following settings: Context menu of a report "Export > DXF/DWG". docmgr.saveasdxf a PrintDocuments PrintDocuments(ByVal documents As Object) As Long Transfers the collection of random documents to the Windows printer dialog. When the function is executed, the "Print" user interface opens. The uccprintdirect parameter deactivates the printer dialog and prints the collection of documents with the default printer properties on the default printer. The Silent parameter suppresses any possible feedback windows. Collection of documents to be printed. docmgr.printdocuments a CopyAndCalcutlateDocument CopyAndCalcutlateDocument(ByVal SourceFile As String, ByVal pltdoc As IComosDDocument, Optional ByVal WithIndexUpdater As Boolean = True) As Boolean Imports a random document from the file system to COMOS. The import works without user interface. When the function is executed, the document that is to be imported is created below 6 Programming Manual, 03/2017 V10.2.1, A5E39863290-AA
Class: DocumentManager 1.1 DocumentManager: Function the owner without an additional prompt. In the example below, the owner is the object set in the "Object A:" field of the object debugger. SourceFile Path and file name of the document to be imported. pltdoc COMOS object of the COMOS document to be created. Required properties: See example below. WithIndexUpdater True: Updates the document index after the import Object set in the "Object A:" field of the object debugger Set Document1 = a.documents.createnew Document1.Name = "MeinExcel" & Now() Document1.DocumentType = Project.DocumentTypes.Item("Excel") ' Copy File Set DocMgr = CreateObject("ComosDocumentManager.DocumentManager") Call DocMgr.CopyAndCalcutlateDocument("C:\Temp\Test.xls", Document1) ExportToPDF ExportToPDF(ByVal documents As Object) As Long Transfers the reports to the export interface for intelligent PDF export. When the function is executed, the "PDF export" user interface opens. The settings in this user interface correspond to the following settings: Context menu of a report "Export > PDF". docmgr.exporttopdf a PrintToRevisionPrinter PrintToRevisionPrinter(ByVal documents As Object) As Long Transfers the reports to the revision printer. When the function is executed, the "Print with revision printer" user interface opens. The settings in this user interface correspond to the following settings: COMOS menu "Documents > Print with revision printer". Select a report and then "Execute". docmgr.printtorevisionprinter a Programming Manual, 03/2017 V10.2.1, A5E39863290-AA 7
Class: DocumentManager 1.1 DocumentManager: Function 8 Programming Manual, 03/2017 V10.2.1, A5E39863290-AA