Professional Documents
Culture Documents
ApplicationDataPath)
Set TS = FSO.OpenTextFile("D:\SMR Graphics List.txt", ForWriting, True)
For Each File In Folder.Files
If Not Left(File.Name, 1) = "@" And LCase(Right(File.Name, 4)) = ".pdl"
Then
Set Doc = grafexe.Documents.Open(File.Path)
TS.WriteLine Doc.Name
Doc.Width = 1280
Doc.Height = 845
Doc.Properties("BackColor") = 15066597
For Each Obj In Doc.HMIObjects
If Not Obj.Type = "HMIGroup" Then
Obj.Top = Obj.Top + 20
End If
Next
Set Obj = Doc.HMIObjects.AddHMIObject("TitleBar", "HMIStaticText")
Obj.Left = 0
Obj.Top = 0
Obj.Width = 1280
Obj.Height = 20
Obj.Properties("Text") = " " & File.Name
Doc.Grid = False
Obj.Properties("FontBold") = True
Set objView = ActiveDocument.Views(1)
objView.PrintDocument
Doc.Close
End If
Next
End Sub
Sub FindTag()
Dim FSO As New FileSystemObject
Dim Folder As Folder
Dim File As File
Dim Doc As Document
Dim Obj As HMIObject
Dim Prop As HMIProperty
Dim VarName As String
Dim VarToFind As String
Dim TS As TextStream
Dim Source As TextStream
Dim VarsToFind() As String
Set Source = FSO.OpenTextFile("D:\TagsToFind.txt", ForReading, True)
Set Folder = FSO.GetFolder(grafexe.ApplicationDataPath)
Set TS = FSO.OpenTextFile("D:\TagsFound.csv", ForWriting, True)
Counter = 0
While Not Source.AtEndOfStream
TextLine = Source.ReadLine
If Len(TextLine) > 0 Then
Counter = Counter + 1
ReDim Preserve VarsToFind(Counter) As String
VarsToFind(Counter) = TextLine
End If
Wend
Source.Close
For Each File In Folder.Files
Dim
Dim
Dim
Dim
Dim
Dim
Dim
File As File
Doc As Document
Obj As HMIObject
objView As HMIView
TS As TextStream
colSearchResults As HMICollection
objStaticText As HMIStaticText