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