1Attribute VB_Name = "ApplicationSpecific" 2'/************************************************************************* 3' * 4' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5' 6' Copyright 2000, 2010 Oracle and/or its affiliates. 7' 8' OpenOffice.org - a multi-platform office productivity suite 9' 10' This file is part of OpenOffice.org. 11' 12' OpenOffice.org is free software: you can redistribute it and/or modify 13' it under the terms of the GNU Lesser General Public License version 3 14' only, as published by the Free Software Foundation. 15' 16' OpenOffice.org is distributed in the hope that it will be useful, 17' but WITHOUT ANY WARRANTY; without even the implied warranty of 18' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19' GNU Lesser General Public License version 3 for more details 20' (a copy is included in the LICENSE file that accompanied this code). 21' 22' You should have received a copy of the GNU Lesser General Public License 23' version 3 along with OpenOffice.org. If not, see 24' <http://www.openoffice.org/license.html> 25' for a copy of the LGPLv3 License. 26' 27' ************************************************************************/ 28 29Option Explicit 30 31'*** Do NOT add any new categories - use those listed below or else the results spreadsheet and 32'*** issues list will be out of sync 33Public Const GlbPowerPoint = True 34 35'** Issue Categories 36Public Const CID_INFORMATION_REFS = 0 37Public Const CID_ACTION_SETTINGS = 1 38Public Const CID_CONTENT_AND_DOCUMENT_PROPERTIES = 2 39Public Const CID_FIELDS = 3 40Public Const CID_FORMAT = 4 41Public Const CID_NOTES_AND_HANDOUTS = 5 42Public Const CID_OBJECTS_GRAPHICS_TEXTBOXES = 6 43Public Const CID_PORTABILITY = 7 44Public Const CID_VBA_MACROS = 8 45Public Const CTOTAL_CATEGORIES = 8 46 47'** PP - XML Issue and SubIssue strings 48Public Const CSTR_ISSUE_OBJECTS_GRAPHICS_AND_TEXTBOXES = "ObjectsGraphicsAndTextboxes" 49 50Public Const CSTR_SUBISSUE_COMMENT = "Comment" 51Public Const CSTR_SUBISSUE_MOVIE = "Movie" 52Public Const CSTR_SUBISSUE_BACKGROUND = "Background" 53Public Const CSTR_SUBISSUE_NUMBERING = "Numbering" 54Public Const CSTR_SUBISSUE_HYPERLINK = "Hyperlink" 55Public Const CSTR_SUBISSUE_HYPERLINK_SPLIT = "HyperlinkSplit" 56Public Const CSTR_SUBISSUE_TEMPLATE = "Template" 57Public Const CSTR_SUBISSUE_TABSTOP = "Tabstop" 58Public Const CSTR_SUBISSUE_FONTS = "Fonts" 59 60'** END PP - XML Issue and SubIssue strings 61 62Public Const CAPPNAME_WORD = "Word" 63'Public Const CAPPNAME_WORD_DOC = ".doc" 64'Public Const CAPPNAME_WORD_DOT = ".dot" 65 66Public Const CAPPNAME_EXCEL = "Excel" 67'Public Const CAPPNAME_EXCEL_DOC = ".xls" 68'Public Const CAPPNAME_EXCEL_DOT = ".xlt" 69 70Public Const CAPPNAME_POWERPOINT = "PowerPoint" 71Public Const CAPPNAME_PP_DOC = ".ppt" 72Public Const CAPPNAME_PP_DOT = ".pot" 73 74'Public Const CAPP_DOCPROP_LOCATION = "Document" 75'Public Const CAPP_DOCPROP_LOCATION = "Workbook" 76Public CAPP_DOCPROP_LOCATION As String 77 78 79'Public Const CAPP_XMLDOCPROP_LOCATION = "Document" 80'Public Const CAPP_XMLDOCPROP_LOCATION = "Workbook" 81Public Const CAPP_XMLDOCPROP_LOCATION = "Presentation" 82 83Public Const CTHIS_DOCUMENT = "ThisDocument" 84Public Const CTOPLEVEL_PROJECT = "Project" 85 86Const CSTART_DIR = 1 87Const CSTORE_TO_DIR = 2 88Const CRESULTS_FILE = 3 89Const CRESULTS_TEMPALTE = 4 90Const COVERWRITE_FILE = 5 91Const CNEW_RESULTS_FILE = 6 92Const CDOCUMENT = 7 93Const CTEMPLATE = 8 94Const CINCLUDE_SUBDIRS = 9 95Const CLOG_FILE = 10 96Const CDEBUG_LEVEL = 11 97 98Public Function getAppSpecificDocExt() As String 99 getAppSpecificDocExt = CAPPNAME_PP_DOC 100End Function 101Public Function getAppSpecificTemplateExt() As String 102 getAppSpecificTemplateExt = CAPPNAME_PP_DOT 103End Function 104 105Public Function getAppSpecificPath() As String 106 getAppSpecificPath = ActivePresentation.path 107End Function 108Public Function getAppSpecificApplicationName() As String 109 getAppSpecificApplicationName = CAPPNAME_POWERPOINT 110End Function 111 112Public Function getAppSpecificCustomDocProperties(currDoc As Presentation) As DocumentProperties 113 Set getAppSpecificCustomDocProperties = currDoc.CustomDocumentProperties 114End Function 115Public Function getAppSpecificCommentBuiltInDocProperty(currDoc As Presentation) As DocumentProperty 116 Set getAppSpecificCommentBuiltInDocProperty = currDoc.BuiltInDocumentProperties("Comments") 117End Function 118 119Public Function getAppSpecificVBProject(currDoc as Presentation) As VBProject 120 Set getAppSpecificVBProject = currDoc.VBProject 121End Function 122 123Public Function getAppSpecificOLEClassType(aShape As Shape) As String 124 getAppSpecificOLEClassType = aShape.OLEFormat.ProgID 125End Function 126 127' Workaround as it does not seem to be possible to shut down PP 128' from VB app 129Public Sub QuitPowerPoint() 130 Dim I As Integer 131 On Error Resume Next 132 With Application.Presentations 133 For I = .count To 1 Step -1 134 .item(I).Close 135 Next 136 End With 137 Application.Quit 138End Sub 139 140Public Sub SetAppToMinimized() 141 Application.WindowState = ppWindowMinimized 142End Sub 143 144Public Sub LocalizeResources() 145 On Error GoTo ErrorHandler 146 Dim ppStrings As StringDataManager 147 Set ppStrings = New StringDataManager 148 Dim aPres As Presentation 149 Set aPres = Presentations("_OOoDocAnalysisPPTDriver.ppt") 150 ppStrings.InitStringData (GetResourceDataFileName(aPres.path)) 151 LoadCommonStrings ppStrings 152 LoadPPStrings ppStrings 153 LoadResultsStrings ppStrings 154 Set ppStrings = Nothing 155 156 SetPPDriverText 157FinalExit: 158 Exit Sub 159ErrorHandler: 160 WriteDebug "Presentation_Open : " & Err.Number & " : " & Err.Description 161 GoTo FinalExit 162End Sub 163 164Sub SetPPDriverText() 165 On Error Resume Next 166 CAPP_DOCPROP_LOCATION = RID_STR_COMMON_RESULTS_LOCATION_TYPE_PRESENTATION 167 ActivePresentation.Slides.item(1).Shapes.item("RID_STR_DVR_PP_TXT2").OLEFormat.Object.Text = RID_STR_DVR_PP_TXT2 168 ActivePresentation.Slides.item(1).Shapes.item("RID_STR_DVR_PP_TXT3").OLEFormat.Object.Text = RID_STR_DVR_PP_TXT3 169 ActivePresentation.Slides.item(1).Shapes.item("RID_STR_DVR_PP_TXT4").OLEFormat.Object.Text = RID_STR_DVR_PP_TXT4 170 ActivePresentation.Slides.item(1).Shapes.item("RID_STR_DVR_PP_TXT5").OLEFormat.Object.Text = RID_STR_DVR_PP_TXT5 171 ActivePresentation.Slides.item(1).Shapes.item("RID_STR_DVR_PP_TXT6").OLEFormat.Object.Text = RID_STR_DVR_PP_TXT6 172 ActivePresentation.Slides.item(1).Shapes.item("RID_STR_DVR_PP_TXT7").OLEFormat.Object.Text = RID_STR_DVR_PP_TXT7 173 ActivePresentation.Slides.item(1).Shapes.item("RID_STR_DVR_PP_TXT8").OLEFormat.Object.Text = RID_STR_DVR_PP_TXT8 174End Sub 175 176 177