WORD Some API end UndoRecord unexpected

陈国辉 1 Reputation point
2020-12-07T05:43:43.587+00:00

Dim objUndo As UndoRecord
Set objUndo = Application.UndoRecord
objUndo.StartCustomRecord "AAA"
Selection.TypeText 111
Selection.TypeParagraph
Selection.TypeText 2222
Selection.TypeParagraph

'Selection.Move WdUnits.wdParagraph - 1
Dim xxx As Range
Dim t0 As Table
Set t0 = ActiveDocument.Tables.Item(1)
Set xxx = t0.Range
'xxx.ExportFragment "D:/temp/1.docx", wdFormatDocumentDefault
Debug.Print xxx.xml
Debug.Print xxx.WordOpenXML
't0.Delete --- END CustomRecord
Selection.Range.InsertFile "D:/temp/1.docx" --- END CustomRecord
Selection.Range.ImportFragment "D:/temp/1.docx" --- END CustomRecord
'xxx.Copy

objUndo.EndCustomRecord

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,817 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Emily Hua-MSFT 27,526 Reputation points
    2020-12-07T07:20:28.413+00:00

    @陈国辉
    Threads with tafg "office-word-itpro" focus more on general questions of Word clients.
    Any issue related to API code are not supported on Q&A forum currently, I would suggest you post a new question on the forums poited on the following link.
    Office developer community

    Thanks for your understanding.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments