S
S
Sgr_A2022-02-25 08:23:32
Visual Basic
Sgr_A, 2022-02-25 08:23:32

How to save text with formatting to clipboard?

I do it this way:

Sub Test()

Dim T As Task, Notes As String

For Each T In ActiveSelection.Tasks
 Notes = T.Notes
 PutOnClipboard (Notes)

Next T

End Sub

Public Sub PutOnClipboard(Obj As Variant)

    Dim MyDataObj As New DataObject
    MyDataObj.SetText Obj
    MyDataObj.PutInClipboard

End Sub


Everything is saved, but only in solid text. I can't figure out how to save with formatting.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question