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'** Issue Categories
25cdf0e10cSrcweirPublic Const CID_INFORMATION_REFS = 0
26cdf0e10cSrcweirPublic Const CID_CHANGES_AND_REVIEWING = 1 'no issue logged
27cdf0e10cSrcweirPublic Const CID_CONTENT_AND_DOCUMENT_PROPERTIES = 2
28cdf0e10cSrcweirPublic Const CID_CONTROLS = 3 'no issue logged
29cdf0e10cSrcweirPublic Const CID_FIELDS = 4
30cdf0e10cSrcweirPublic Const CID_FORMAT = 5
31cdf0e10cSrcweirPublic Const CID_INDEX_AND_REFERENCES = 6
32cdf0e10cSrcweirPublic Const CID_OBJECTS_GRAPHICS_FRAMES = 7
33cdf0e10cSrcweirPublic Const CID_PORTABILITY = 8
34cdf0e10cSrcweirPublic Const CID_TABLES = 9
35cdf0e10cSrcweirPublic Const CID_VBA_MACROS = 10
36cdf0e10cSrcweirPublic Const CID_WRITING_AIDS = 11
37cdf0e10cSrcweirPublic Const CTOTAL_CATEGORIES = 11
38cdf0e10cSrcweir
39cdf0e10cSrcweir'** Word - XML Issue and SubIssue strings
40cdf0e10cSrcweirPublic Const CSTR_ISSUE_CHANGES_AND_REVIEWING = "ChangesAndReviewing"
41cdf0e10cSrcweirPublic Const CSTR_ISSUE_CONTROLS = "Controls"
42cdf0e10cSrcweirPublic Const CSTR_ISSUE_FIELDS = "Fields"
43cdf0e10cSrcweirPublic Const CSTR_ISSUE_INDEX_AND_REFERENCES = "IndexesAndReferences"
44cdf0e10cSrcweirPublic Const CSTR_ISSUE_TABLES = "Tables"
45cdf0e10cSrcweir
46cdf0e10cSrcweirPublic Const CSTR_SUBISSUE_APPEARANCE = "Appearance"
47cdf0e10cSrcweirPublic Const CSTR_SUBISSUE_BORDER_STYLES = "BorderStyles"
48cdf0e10cSrcweirPublic Const CSTR_SUBISSUE_CELL_SPAN_PAGE = "CellSpanningPage"
49cdf0e10cSrcweirPublic Const CSTR_SUBISSUE_COMMENT = "Comment"
50cdf0e10cSrcweirPublic Const CSTR_SUBISSUE_CUSTOM_BULLET_LIST = "CustomBulletList"
51cdf0e10cSrcweirPublic Const CSTR_SUBISSUE_FORM_FIELD = "FormField"
52cdf0e10cSrcweirPublic Const CSTR_SUBISSUE_MAILMERGE_DATASOURCE = "MailMergeDatasource"
53cdf0e10cSrcweirPublic Const CSTR_SUBISSUE_MAILMERGE_FIELD = "MailMergeField"
54cdf0e10cSrcweirPublic Const CSTR_SUBISSUE_NESTED_TABLES = "NestedTables"
55cdf0e10cSrcweirPublic Const CSTR_SUBISSUE_TABLE_OF_AUTHORITIES = "TableOfAuthorities"
56cdf0e10cSrcweirPublic Const CSTR_SUBISSUE_TABLE_OF_AUTHORITIES_FIELD = "TableOfAuthoritiesField"
57cdf0e10cSrcweirPublic Const CSTR_SUBISSUE_TABLE_OF_CONTENTS = "TableOfContents"
58cdf0e10cSrcweir'** END Word - XML Issue and SubIssue strings
59cdf0e10cSrcweir
60cdf0e10cSrcweirPublic Const CAPPNAME_WORD = "Word"
61cdf0e10cSrcweirPublic Const CAPPNAME_WORD_DOC = ".doc"
62cdf0e10cSrcweirPublic Const CAPPNAME_WORD_DOT = ".dot"
63cdf0e10cSrcweir
64cdf0e10cSrcweirPublic Const CAPPNAME_EXCEL = "Excel"
65cdf0e10cSrcweirPublic Const CAPPNAME_EXCEL_DOC = ".xls"
66cdf0e10cSrcweirPublic Const CAPPNAME_EXCEL_DOT = ".xlt"
67cdf0e10cSrcweir
68cdf0e10cSrcweirPublic Const CAPPNAME_POWERPOINT = "PowerPoint"
69cdf0e10cSrcweirPublic Const CAPPNAME_PP_DOC = ".ppt"
70cdf0e10cSrcweirPublic Const CAPPNAME_PP_DOT = ".pot"
71cdf0e10cSrcweir
72cdf0e10cSrcweirPublic CAPP_DOCPROP_LOCATION As String
73cdf0e10cSrcweir'Public Const CAPP_DOCPROP_LOCATION = RID_STR_COMMON_RESULTS_LOCATION_TYPE_WORKBOOK
74cdf0e10cSrcweir'Public Const CAPP_DOCPROP_LOCATION = RID_STR_COMMON_RESULTS_LOCATION_TYPE_PRESENTATION
75cdf0e10cSrcweir
76cdf0e10cSrcweirPublic Const CAPP_XMLDOCPROP_LOCATION = "Document"
77cdf0e10cSrcweir'Public Const CAPP_XMLDOCPROP_LOCATION = "Workbook"
78cdf0e10cSrcweir'Public Const CAPP_XMLDOCPROP_LOCATION = "Presentation"
79cdf0e10cSrcweir
80cdf0e10cSrcweirPublic Const CTHIS_DOCUMENT = "ThisDocument"
81cdf0e10cSrcweirPublic Const CTOPLEVEL_PROJECT = "Project"
82cdf0e10cSrcweir
83cdf0e10cSrcweirPublic Function getAppSpecificDocExt() As String
84cdf0e10cSrcweir    getAppSpecificDocExt = CAPPNAME_WORD_DOC
85cdf0e10cSrcweirEnd Function
86cdf0e10cSrcweirPublic Function getAppSpecificTemplateExt() As String
87cdf0e10cSrcweir    getAppSpecificTemplateExt = CAPPNAME_WORD_DOT
88cdf0e10cSrcweirEnd Function
89cdf0e10cSrcweirPublic Function getAppSpecificPath() As String
90cdf0e10cSrcweir    getAppSpecificPath = ActiveDocument.path
91cdf0e10cSrcweirEnd Function
92cdf0e10cSrcweirPublic Function getAppSpecificApplicationName() As String
93cdf0e10cSrcweir    getAppSpecificApplicationName = CAPPNAME_WORD
94cdf0e10cSrcweirEnd Function
95cdf0e10cSrcweir
96cdf0e10cSrcweirPublic Function getAppSpecificCustomDocProperties(currDoc As Document) As DocumentProperties
97cdf0e10cSrcweir    Set getAppSpecificCustomDocProperties = currDoc.CustomDocumentProperties
98cdf0e10cSrcweirEnd Function
99cdf0e10cSrcweirPublic Function getAppSpecificCommentBuiltInDocProperty(currDoc As Document) As DocumentProperty
100cdf0e10cSrcweir    Set getAppSpecificCommentBuiltInDocProperty = currDoc.BuiltInDocumentProperties(wdPropertyComments)
101cdf0e10cSrcweirEnd Function
102cdf0e10cSrcweir
103cdf0e10cSrcweirPublic Function getAppSpecificVBProject(currDoc As Document) As VBProject
104cdf0e10cSrcweir    Set getAppSpecificVBProject = currDoc.VBProject
105cdf0e10cSrcweirEnd Function
106cdf0e10cSrcweir
107cdf0e10cSrcweirPublic Function getAppSpecificOLEClassType(aShape As Shape) As String
108cdf0e10cSrcweir    Dim objType As String
109cdf0e10cSrcweir
110cdf0e10cSrcweir    If aShape.OLEFormat.ProgID = "" Then
111cdf0e10cSrcweir        objType = aShape.OLEFormat.ClassType
112cdf0e10cSrcweir    Else
113cdf0e10cSrcweir        objType = aShape.OLEFormat.ProgID
114cdf0e10cSrcweir    End If
115cdf0e10cSrcweir
116cdf0e10cSrcweir    getAppSpecificOLEClassType = objType
117cdf0e10cSrcweirEnd Function
118cdf0e10cSrcweir
119cdf0e10cSrcweirPublic Sub SetAppToMinimized()
120cdf0e10cSrcweir    Application.WindowState = wdWindowStateMinimize
121cdf0e10cSrcweir    Application.Visible = False
122cdf0e10cSrcweirEnd Sub
123cdf0e10cSrcweir
124cdf0e10cSrcweirPublic Sub LocalizeResources()
125cdf0e10cSrcweir    Dim wrdStrings As StringDataManager
126cdf0e10cSrcweir    Set wrdStrings = New StringDataManager
127cdf0e10cSrcweir
128cdf0e10cSrcweir    wrdStrings.InitStringData (GetResourceDataFileName(ThisDocument.path))
129cdf0e10cSrcweir    LoadCommonStrings wrdStrings
130cdf0e10cSrcweir    LoadWordStrings wrdStrings
131cdf0e10cSrcweir    LoadResultsStrings wrdStrings
132cdf0e10cSrcweir    Set wrdStrings = Nothing
133cdf0e10cSrcweir
134cdf0e10cSrcweir    'SetWordDriverText
135cdf0e10cSrcweirEnd Sub
136cdf0e10cSrcweir
137cdf0e10cSrcweir' Set the loaded string variable into the fields in the document
138cdf0e10cSrcweirPrivate Sub SetWordDriverText()
139cdf0e10cSrcweir    On Error Resume Next
140cdf0e10cSrcweir    CAPP_DOCPROP_LOCATION = RID_STR_COMMON_RESULTS_LOCATION_TYPE_DOCUMENT
141cdf0e10cSrcweir    ThisDocument.FormFields.item("RID_STR_WDVR_SOANA").Result = RID_STR_WDVR_SOANA
142cdf0e10cSrcweir    ThisDocument.FormFields.item("RID_STR_WDVR_INTRO").Result = RID_STR_WDVR_INTRO
143cdf0e10cSrcweir    ThisDocument.FormFields.item("RID_STR_WDVR_TITLE").Result = RID_STR_WDVR_TITLE
144cdf0e10cSrcweir    ThisDocument.FormFields.item("RID_STR_WDVR_PURPO").Result = RID_STR_WDVR_PURPO
145cdf0e10cSrcweir    ThisDocument.FormFields.item("RID_STR_WDVR_PARA1").Result = RID_STR_WDVR_PARA1
146cdf0e10cSrcweir    ThisDocument.FormFields.item("RID_STR_WDVR_ISSUE").Result = RID_STR_WDVR_ISSUE
147cdf0e10cSrcweir    ThisDocument.FormFields.item("RID_STR_WDVR_PARA2").Result = RID_STR_WDVR_PARA2
148cdf0e10cSrcweirEnd Sub
149cdf0e10cSrcweir
150