View Single Post
 
Old 07-28-2017, 06:35 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Here at least your customization file name is wrong. You are also missing whitespace before the onAction attribute. Groups don't have images associated with them.

You are aware that your code is going to destroy any existing ribbon or QAT customizations. Correct?

Code:
hFile = FreeFile
  User = Environ("HomePath")
  path = "C:" & User & "\AppData\Local\Microsoft\Office\"
  fileName = "Word.officeUI" '*** This is the filename that works here.
  ribbonXml = "<mso:customUI xmlns:mso='http://schemas.microsoft.com/office/2009/07/customui'>" & vbNewLine
  ribbonXml = ribbonXml + "  <mso:ribbon>" & vbNewLine
  ribbonXml = ribbonXml + "    <mso:qat/>" & vbNewLine
  ribbonXml = ribbonXml + "    <mso:tabs>" & vbNewLine
  ribbonXml = ribbonXml + "      <mso:tab id='mso_c1.109B239D' label='Formatting' insertBeforeQ='mso:TabDeveloper'>" & vbNewLine
  ribbonXml = ribbonXml + "        <mso:group id='mso_c2.109B239D' label='Export' autoScale='true'>" & vbNewLine
  ribbonXml = ribbonXml + "          <mso:button id='x1:startExport_0_109F2716' " & vbNewLine
  ribbonXml = ribbonXml + "imageMso='ViewFullScreenView' onAction='startExport' visible='true'/>" & vbNewLine
  ribbonXml = ribbonXml + "        </mso:group>"
  ribbonXml = ribbonXml + "      </mso:tab>" & vbNewLine
  ribbonXml = ribbonXml + "    </mso:tabs>" & vbNewLine
  ribbonXml = ribbonXml + "  </mso:ribbon>" & vbNewLine
  ribbonXml = ribbonXml + "</mso:customUI>"
  Open path & fileName For Output Access Write As hFile
  Print #hFile, ribbonXml
  Close hFile
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote