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'** Issue Categories
25Public Const CID_INFORMATION_REFS = 0
26Public Const CID_CHANGES_AND_REVIEWING = 1
27Public Const CID_CHARTS_TABLES = 2
28Public Const CID_CONTENT_AND_DOCUMENT_PROPERTIES = 3
29Public Const CID_CONTROLS = 4
30Public Const CID_FILTERS = 5
31Public Const CID_FORMAT = 6
32Public Const CID_FUNCTIONS = 7
33Public Const CID_OBJECTS_GRAPHICS = 8
34Public Const CID_PORTABILITY = 9
35Public Const CID_VBA_MACROS = 10
36Public Const CTOTAL_CATEGORIES = 10
37
38'** Excel - XML Issue and SubIssue strings
39Public Const CSTR_ISSUE_CHANGES_AND_REVIEWING = "ChangesAndReviewing"
40Public Const CSTR_ISSUE_CHARTS_TABLES = "ChartsAndTables"
41Public Const CSTR_ISSUE_CONTROLS = "Controls"
42Public Const CSTR_ISSUE_FUNCTIONS = "Functions"
43Public Const CSTR_ISSUE_OBJECTS_GRAPHICS = "ObjectsAndGraphics"
44
45Public Const CSTR_SUBISSUE_ATTRIBUTES = "CellAttributes"
46Public Const CSTR_SUBISSUE_DATEDIF = "DATEDIF"
47Public Const CSTR_SUBISSUE_EMBEDDED_CHART = "EmbeddedChart"
48Public Const CSTR_SUBISSUE_ERROR_TYPE = "ERROR.TYPE"
49Public Const CSTR_SUBISSUE_EXTERNAL = "External"
50Public Const CSTR_SUBISSUE_INFO = "INFO"
51Public Const CSTR_SUBISSUE_MAX_ROWS_EXCEEDED = "MaximumRowsExceeded"
52Public Const CSTR_SUBISSUE_MAX_SHEETS_EXCEEDED = "MaximumSheetsExceeded"
53Public Const CSTR_SUBISSUE_PAGE_SETUP = "PageSetup"
54Public Const CSTR_SUBISSUE_PASSWORD_PROTECTION = "PasswordProtection"
55Public Const CSTR_SUBISSUE_PHONETIC = "PHONETIC"
56Public Const CSTR_SUBISSUE_SHEET_CHART = "SheetChart"
57Public Const CSTR_SUBISSUE_WORKBOOK_PROTECTION = "WorkbookProtection"
58Public Const CSTR_SUBISSUE_ZOOM = "Zoom"
59
60Public Const CSTR_SUBISSUE_CHART_COMPLEX = "ChartIssuesComplex"
61Public Const CSTR_SUBISSUE_CHART_MINOR = "ChartIssuesMinor"
62Public Const CSTR_SUBISSUE_CHART_PIVOT = "Pivot"
63Public Const CSTR_SUBISSUE_INVALID_WORKSHEET_NAME = "InvalidWorksheetName"
64Public Const CSTR_SUBISSUE_DB_QUERY = "DBQuery"
65
66'** END Excel - XML Issue and SubIssue strings
67
68
69Public Const CAPPNAME_WORD = "Word"
70'Public Const CAPPNAME_WORD_DOC = ".doc"
71'Public Const CAPPNAME_WORD_DOT = ".dot"
72
73Public Const CAPPNAME_EXCEL = "Excel"
74Public Const CAPPNAME_EXCEL_DOC = ".xls"
75Public Const CAPPNAME_EXCEL_DOT = ".xlt"
76
77Public Const CAPPNAME_POWERPOINT = "PowerPoint"
78'Public Const CAPPNAME_PP_DOC = ".ppt"
79'Public Const CAPPNAME_PP_DOT = ".pot"
80
81'Public Const CAPP_DOCPROP_LOCATION = "Document"
82Public CAPP_DOCPROP_LOCATION As String
83'Public Const CAPP_DOCPROP_LOCATION = "Presentation"
84
85'Public Const CAPP_XMLDOCPROP_LOCATION = "Document"
86Public Const CAPP_XMLDOCPROP_LOCATION = "Workbook"
87'Public Const CAPP_XMLDOCPROP_LOCATION = "Presentation"
88
89Public Const CTHIS_DOCUMENT = "ThisWorkbook"
90Public Const CTOPLEVEL_PROJECT = "VBAProject"
91
92Public Function getAppSpecificDocExt() As String
93    getAppSpecificDocExt = CAPPNAME_EXCEL_DOC
94End Function
95Public Function getAppSpecificTemplateExt() As String
96    getAppSpecificTemplateExt = CAPPNAME_EXCEL_DOT
97End Function
98
99Public Function getAppSpecificPath() As String
100    getAppSpecificPath = ActiveWorkbook.path
101End Function
102Public Function getAppSpecificApplicationName() As String
103    getAppSpecificApplicationName = CAPPNAME_EXCEL
104End Function
105
106Public Function getAppSpecificCustomDocProperties(currDoc As Workbook) As DocumentProperties
107    Set getAppSpecificCustomDocProperties = currDoc.CustomDocumentProperties
108End Function
109Public Function getAppSpecificCommentBuiltInDocProperty(currDoc As Workbook) As DocumentProperty
110    Set getAppSpecificCommentBuiltInDocProperty = currDoc.BuiltinDocumentProperties("Comments")
111End Function
112
113Public Function getAppSpecificVBProject(currDoc As Workbook) As VBProject
114    Set getAppSpecificVBProject = currDoc.VBProject
115End Function
116
117Public Function getAppSpecificOLEClassType(aShape As Shape) As String
118    Dim objType As String
119
120    If aShape.OLEFormat.ProgID = "" Then
121        objType = aShape.OLEFormat.ClassType
122    Else
123        objType = aShape.OLEFormat.ProgID
124    End If
125
126    getAppSpecificOLEClassType = objType
127End Function
128
129Public Sub SetAppToMinimized()
130    Application.WindowState = xlMinimized
131    Application.Visible = False
132End Sub
133
134Public Sub LocalizeResources()
135    Dim xlStrings As StringDataManager
136    Set xlStrings = New StringDataManager
137
138    xlStrings.InitStringData (GetResourceDataFileName(ThisWorkbook.path))
139    LoadCommonStrings xlStrings
140    LoadExcelStrings xlStrings
141    LoadResultsStrings xlStrings
142    Set xlStrings = Nothing
143
144    SetWBDriverText
145End Sub
146
147Public Sub SetWBDriverText()
148    On Error Resume Next
149    CAPP_DOCPROP_LOCATION = RID_STR_COMMON_RESULTS_LOCATION_TYPE_DOCUMENT
150    ThisWorkbook.Names("RID_STR_DVR_XL_EXCEL_DRIVER").RefersToRange.Cells(1, 1) = RID_STR_DVR_XL_EXCEL_DRIVER
151    ThisWorkbook.Names("RID_STR_DVR_XL_ISSUES").RefersToRange.Cells(1, 1) = RID_STR_DVR_XL_ISSUES
152    ThisWorkbook.Names("RID_STR_DVR_XL_PURPOSE").RefersToRange.Cells(1, 1) = RID_STR_DVR_XL_PURPOSE
153    ThisWorkbook.Names("RID_STR_DVR_XL_READ_README").RefersToRange.Cells(1, 1) = RID_STR_DVR_XL_READ_README
154    ThisWorkbook.Names("RID_STR_DVR_XL_THE_MACROS").RefersToRange.Cells(1, 1) = RID_STR_DVR_XL_THE_MACROS
155    ThisWorkbook.Names("RID_STR_DVR_XL_THIS_DOC").RefersToRange.Cells(1, 1) = RID_STR_DVR_XL_THIS_DOC
156    ThisWorkbook.Names("RID_STR_DVR_XL_TITLE").RefersToRange.Cells(1, 1) = RID_STR_DVR_XL_TITLE
157End Sub
158
159