简体   繁体   中英

Ms Word Vba Command Button Insert Text on Word Doc

on click of the Command Button on MS WORD VBA FORM, a specific Text has to be inserted on the same MS Word Document on the place where the blinking cursor/Selection cursor is placed.

can someone place help me.

Private Sub CommandButton1_Click()
Me.Hide
With ActiveDocument.ActiveWindow.Selection

    .TypeText Text:="Your text here"

End With
End Sub

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM