1Attribute VB_Name = "ApplicationSpecific"
2'*************************************************************************
3'
4'  Licensed to the Apache Software Foundation (ASF) under one
5'  or more contributor license agreements.  See the NOTICE file
6'  distributed with this work for additional information
7'  regarding copyright ownership.  The ASF licenses this file
8'  to you under the Apache License, Version 2.0 (the
9'  "License"); you may not use this file except in compliance
10'  with the License.  You may obtain a copy of the License at
11'
12'    http://www.apache.org/licenses/LICENSE-2.0
13'
14'  Unless required by applicable law or agreed to in writing,
15'  software distributed under the License is distributed on an
16'  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17'  KIND, either express or implied.  See the License for the
18'  specific language governing permissions and limitations
19'  under the License.
20'
21'*************************************************************************
22Option Explicit
23
24'*** Do NOT add any new categories - use those listed below or else the results spreadsheet and
25'*** issues list will be out of sync
26Public Const GlbPowerPoint = True
27
28'** Issue Categories
29Public Const CID_INFORMATION_REFS = 0
30Public Const CID_ACTION_SETTINGS = 1
31Public Const CID_CONTENT_AND_DOCUMENT_PROPERTIES = 2
32Public Const CID_FIELDS = 3
33Public Const CID_FORMAT = 4
34Public Const CID_NOTES_AND_HANDOUTS = 5
35Public Const CID_OBJECTS_GRAPHICS_TEXTBOXES = 6
36Public Const CID_PORTABILITY = 7
37Public Const CID_VBA_MACROS = 8
38Public Const CTOTAL_CATEGORIES = 8
39
40'** PP - XML Issue and SubIssue strings
41Public Const CSTR_ISSUE_OBJECTS_GRAPHICS_AND_TEXTBOXES = "ObjectsGraphicsAndTextboxes"
42
43Public Const CSTR_SUBISSUE_COMMENT = "Comment"
44Public Const CSTR_SUBISSUE_MOVIE = "Movie"
45Public Const CSTR_SUBISSUE_BACKGROUND = "Background"
46Public Const CSTR_SUBISSUE_NUMBERING = "Numbering"
47Public Const CSTR_SUBISSUE_HYPERLINK = "Hyperlink"
48Public Const CSTR_SUBISSUE_HYPERLINK_SPLIT = "HyperlinkSplit"
49Public Const CSTR_SUBISSUE_TEMPLATE = "Template"
50Public Const CSTR_SUBISSUE_TABSTOP = "Tabstop"
51Public Const CSTR_SUBISSUE_FONTS = "Fonts"
52
53'** END PP - XML Issue and SubIssue strings
54
55Public Const CAPPNAME_WORD = "Word"
56'Public Const CAPPNAME_WORD_DOC = ".doc"
57'Public Const CAPPNAME_WORD_DOT = ".dot"
58
59Public Const CAPPNAME_EXCEL = "Excel"
60'Public Const CAPPNAME_EXCEL_DOC = ".xls"
61'Public Const CAPPNAME_EXCEL_DOT = ".xlt"
62
63Public Const CAPPNAME_POWERPOINT = "PowerPoint"
64Public Const CAPPNAME_PP_DOC = ".ppt"
65Public Const CAPPNAME_PP_DOT = ".pot"
66
67'Public Const CAPP_DOCPROP_LOCATION = "Document"
68'Public Const CAPP_DOCPROP_LOCATION = "Workbook"
69Public CAPP_DOCPROP_LOCATION As String
70
71
72'Public Const CAPP_XMLDOCPROP_LOCATION = "Document"
73'Public Const CAPP_XMLDOCPROP_LOCATION = "Workbook"
74Public Const CAPP_XMLDOCPROP_LOCATION = "Presentation"
75
76Public Const CTHIS_DOCUMENT = "ThisDocument"
77Public Const CTOPLEVEL_PROJECT = "Project"
78
79Const CSTART_DIR = 1
80Const CSTORE_TO_DIR = 2
81Const CRESULTS_FILE = 3
82Const CRESULTS_TEMPALTE = 4
83Const COVERWRITE_FILE = 5
84Const CNEW_RESULTS_FILE = 6
85Const CDOCUMENT = 7
86Const CTEMPLATE = 8
87Const CINCLUDE_SUBDIRS = 9
88Const CLOG_FILE = 10
89Const CDEBUG_LEVEL = 11
90
91Public Function getAppSpecificDocExt() As String
92    getAppSpecificDocExt = CAPPNAME_PP_DOC
93End Function
94Public Function getAppSpecificTemplateExt() As String
95    getAppSpecificTemplateExt = CAPPNAME_PP_DOT
96End Function
97
98Public Function getAppSpecificPath() As String
99    getAppSpecificPath = ActivePresentation.path
100End Function
101Public Function getAppSpecificApplicationName() As String
102    getAppSpecificApplicationName = CAPPNAME_POWERPOINT
103End Function
104
105Public Function getAppSpecificCustomDocProperties(currDoc As Presentation) As DocumentProperties
106    Set getAppSpecificCustomDocProperties = currDoc.CustomDocumentProperties
107End Function
108Public Function getAppSpecificCommentBuiltInDocProperty(currDoc As Presentation) As DocumentProperty
109    Set getAppSpecificCommentBuiltInDocProperty = currDoc.BuiltInDocumentProperties("Comments")
110End Function
111
112Public Function getAppSpecificVBProject(currDoc as Presentation) As VBProject
113    Set getAppSpecificVBProject = currDoc.VBProject
114End Function
115
116Public Function getAppSpecificOLEClassType(aShape As Shape) As String
117    getAppSpecificOLEClassType = aShape.OLEFormat.ProgID
118End Function
119
120' Workaround as it does not seem to be possible to shut down PP
121' from VB app
122Public Sub QuitPowerPoint()
123    Dim I As Integer
124    On Error Resume Next
125    With Application.Presentations
126    For I = .count To 1 Step -1
127        .item(I).Close
128    Next
129    End With
130    Application.Quit
131End Sub
132
133Public Sub SetAppToMinimized()
134    Application.WindowState = ppWindowMinimized
135End Sub
136
137Public Sub LocalizeResources()
138    On Error GoTo ErrorHandler
139    Dim ppStrings As StringDataManager
140    Set ppStrings = New StringDataManager
141    Dim aPres As Presentation
142    Set aPres = Presentations("_OOoDocAnalysisPPTDriver.ppt")
143    ppStrings.InitStringData (GetResourceDataFileName(aPres.path))
144    LoadCommonStrings ppStrings
145    LoadPPStrings ppStrings
146    LoadResultsStrings ppStrings
147    Set ppStrings = Nothing
148
149    SetPPDriverText
150FinalExit:
151    Exit Sub
152ErrorHandler:
153    WriteDebug "Presentation_Open : " & Err.Number & " : " & Err.Description
154    GoTo FinalExit
155End Sub
156
157Sub SetPPDriverText()
158    On Error Resume Next
159    CAPP_DOCPROP_LOCATION = RID_STR_COMMON_RESULTS_LOCATION_TYPE_PRESENTATION
160    ActivePresentation.Slides.item(1).Shapes.item("RID_STR_DVR_PP_TXT2").OLEFormat.Object.Text = RID_STR_DVR_PP_TXT2
161    ActivePresentation.Slides.item(1).Shapes.item("RID_STR_DVR_PP_TXT3").OLEFormat.Object.Text = RID_STR_DVR_PP_TXT3
162    ActivePresentation.Slides.item(1).Shapes.item("RID_STR_DVR_PP_TXT4").OLEFormat.Object.Text = RID_STR_DVR_PP_TXT4
163    ActivePresentation.Slides.item(1).Shapes.item("RID_STR_DVR_PP_TXT5").OLEFormat.Object.Text = RID_STR_DVR_PP_TXT5
164    ActivePresentation.Slides.item(1).Shapes.item("RID_STR_DVR_PP_TXT6").OLEFormat.Object.Text = RID_STR_DVR_PP_TXT6
165    ActivePresentation.Slides.item(1).Shapes.item("RID_STR_DVR_PP_TXT7").OLEFormat.Object.Text = RID_STR_DVR_PP_TXT7
166    ActivePresentation.Slides.item(1).Shapes.item("RID_STR_DVR_PP_TXT8").OLEFormat.Object.Text = RID_STR_DVR_PP_TXT8
167End Sub
168
169
170