Итак, следуя https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2010/ee767705(v=office.14)?redirectedfrom=MSDN Я пытался перенести файл MSProject.OfficeUI, содержащий мои пользовательские значки, в код для запуска из этого проекта при открытии.Это было связано с переходом на новый сервис, где пользователь не сможет получить доступ к данным приложения и желанием сохранить функции доступными.
Как бы то ни было, хотя у меня нет ошибок в коде и я даже прошелся по немучерез F8 новое ребро не создается.
Можете ли вы увидеть что-то, что мне нужно отрегулировать, чтобы сделать эту работу?
Спасибо
Терран
Private Sub Project_Activate(ByVal pj As Project)
AddRibbon
End Sub
Private Sub AddRibbon()
' https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2010/ee767705(v=office.14)?redirectedfrom=MSDN
Dim ribbonXml As String
ribbonXml = "<mso:customUI xmlns:mso=""http://schemas.microsoft.com/office/2009/07/customui"">"
ribbonXml = ribbonXml + " <mso:ribbon>"
ribbonXml = ribbonXml + " <mso:qat/>"
ribbonXml = ribbonXml + " <mso:tabs>"
ribbonXml = ribbonXml + " <mso:tab id=""highlightTab"" label=""Highlight"" insertBeforeQ=""mso:TabFormat"">"
ribbonXml = ribbonXml + " <mso:group id=""toolsGroup"" label=""Tools"" autoScale=""true"">"
ribbonXml = ribbonXml + " <mso:button id=""tools1"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""tools2"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""tools3"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""tools4"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""tools5"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""tools6"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " </mso:group>"
ribbonXml = ribbonXml + " <mso:group id=""viewsGroup"" label=""Views"" autoScale=""true"">"
ribbonXml = ribbonXml + " <mso:button id=""views1"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""views2"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""views3"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""views4"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""views5"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""views6"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""views7"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""views8"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""views9"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""view10"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""views11"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""views12"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " </mso:group>"
ribbonXml = ribbonXml + " <mso:group id=""reportingGroup"" label=""Reporting"" autoScale=""true"">"
ribbonXml = ribbonXml + " <mso:button id=""report1"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""report2"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""report3"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""report4"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""report5"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""report6"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " </mso:group>"
ribbonXml = ribbonXml + " <mso:group id=""utilsGroup"" label=""Utilities"" autoScale=""true"">"
ribbonXml = ribbonXml + " <mso:button id=""util1"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""util2"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""util3"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""util4"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""util5"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""util6"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""util7"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""util8"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""util9"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""util10"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""util11"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " <mso:button id=""util12"" label=""Toggle Manual Task Color"" imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/>"
ribbonXml = ribbonXml + " </mso:group>"
ribbonXml = ribbonXml + " </mso:tab>"
ribbonXml = ribbonXml + " </mso:tabs>"
ribbonXml = ribbonXml + " </mso:ribbon>"
ribbonXml = ribbonXml + "</mso:customUI>"
ActiveProject.SetCustomUI (ribbonXml)
End Sub