Steps to reproduce:
Take attached word document
Execute following Code
RichEdit.LoadDocument("Attached Word Document"); RichEdit.CreateCommand(RichEditCommandId.ClosePageHeaderFooter).Execute(); RichEdit.CreateCommand(RichEditCommandId.EditPageHeader).Execute(); var document = RichEdit.Document.Sections[0].BeginUpdateHeader(); var range = document.CreateRange(563, 13); RichEdit.Document.ChangeActiveDocument(document); RichEdit.Document.CaretPosition = document.CreatePosition(range.Start.ToInt()); RichEdit.ScrollToCaret(0.5f); RichEdit.Document.Selections.Add(range); RichEdit.Document.Sections[0].EndUpdateHeader(document);Result:
ArgumentOutOfRangeException
System.ArgumentOutOfRangeException was unhandled
HResult=-2146233086
Message=Der Index lag außerhalb des Bereichs. Er muss nicht negativ und kleiner als die Auflistung sein.
Parametername: index
ParamName=index
Source=mscorlib
StackTrace:
bei System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
bei DevExpress.XtraRichEdit.Model.IndexedTreeNodeLeafLevel`1.FindItemByIndex(Int32 relativeIndex)
bei DevExpress.XtraRichEdit.Model.IndexedTree`2.FindItemByIndex(TIndex index)
bei DevExpress.XtraRichEdit.Commands.InsertMultiLevelListCommand.AreAllParagraphsHasValidNumberingListType()
bei DevExpress.XtraRichEdit.Commands.InsertMultiLevelListCommand.UpdateUIStateCore(ICommandUIState state)
bei DevExpress.XtraRichEdit.Commands.InsertSimpleListCommand.UpdateUIStateCore(ICommandUIState state)
bei DevExpress.XtraRichEdit.Commands.InsertBulletListCommand.UpdateUIStateCore(ICommandUIState state)
bei DevExpress.Utils.Commands.Command.UpdateUIState(ICommandUIState state)
bei DevExpress.XtraRichEdit.Commands.ToggleListCommandBase.UpdateUIState(ICommandUIState state)
bei DevExpress.XtraBars.Commands.CommandBasedBarCheckItem.UpdateItemVisibility()
bei DevExpress.XtraBars.Commands.ControlCommandBarCheckItem`2.UpdateItemVisibility()
bei DevExpress.XtraBars.Commands.ControlCommandBarCheckItem`2.OnControlUpdateUI(Object sender, EventArgs e)
bei System.EventHandler.Invoke(Object sender, EventArgs e)
bei DevExpress.XtraRichEdit.Internal.InnerRichEditDocumentServer.RaiseUpdateUI()
bei DevExpress.XtraRichEdit.Internal.InnerRichEditControl.OnUpdateUICore()
bei DevExpress.XtraRichEdit.Internal.InnerRichEditControl.OnApplicationIdle()
bei DevExpress.XtraRichEdit.RichEditControl.OnApplicationIdle(Object sender, EventArgs e)
bei DevExpress.XtraRichEdit.Drawing.LeakSafeEventRouter.OnApplicationIdle(Object sender, EventArgs e)
bei System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.Run(Form mainForm)
bei SnapReportTest.Program.Main() in C:\Users\r.grundner\Documents\Visual Studio 2015\Projects\SnapReportTest\SnapReportTest\Program.cs:Zeile 16.
bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()
InnerException:
Expected result:
Field gets selected
No Exception
hth
René
Hi,
We have successfully reproduced the behavior you described and passed this ticket to our developers for further research.
Please bear with us. We will notify you as soon as we make any progress.