![]() |
#4
|
|||
|
|||
![]()
I just tried to adapt for Word, the Excel code that Guessed proposes in the link.
However, I have a problem, Word crashes at the line : CopyMemory myRibbon, lRibbonPointer, LenB(lRibbonPointer) in the Function GetRibbon(...) The application crashes, then restarts the recovered document in read-only mode. Here are the lines I modified to adapt them to Word I added in declaration : Private Declare PtrSafe Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal ByteLen As LongPtr) Then in: Sub RibbonLoaded_MyCustomAddin(ribbon As IRibbonUI) I replaced : ThisWorkbook.Names.Add Name:="RibbonID", RefersTo:=StoreRibbonPointer with : ThisDocument.Variables("RibbonID") = StoreRibbonPointer in : Sub RefreshRibbon() I replaced: Set objRibbon = GetRibbon(Replace(ThisWorkbook.Names("TSGRibbonID" ).RefersTo, "=", "")) by : Set objRibbon = GetRibbon(Replace(ActiveDocument.Variables("Ribbon ID"), "=", "")) Does anyone have the skills to help me? Here I am sinking Sincerely, David |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Upgrading from Trial Version - don't want to lose notebooks! | HyperNote | OneNote | 0 | 05-01-2017 04:24 AM |
![]() |
Ulodesk | Word | 2 | 07-25-2016 06:01 AM |
How can I embed a word document so I don't lose the links therein | Dracven | Outlook | 2 | 03-31-2014 04:02 AM |
How do I lose these dotted lines? | jlumbtx | Word | 4 | 11-09-2013 10:29 PM |
![]() |
shadox | Excel | 1 | 07-31-2012 08:50 PM |