|
Post by johnnyd on Aug 3, 2019 18:30:26 GMT -5
Hi,
I need to create a string containing arrows to paste into Excel.
I thought RTF would do it, but alas not.
Then I thought Unicode might do it, but not sure how to format the data.
The characters are: chr Unicode code ↑ 2191h ↗ 2197h → 2192h ↘ 2198h ↓ 2193h ↙ 2199h ← 2190h ↖ 2196h
The full string will look like: ↑ 111 222 333 444 555 666 ↗ 111 222 333 444 555 666
→ 111 222 333 444 555 666 ↘ 111 222 333 444 555 666
↓ 111 222 333 444 555 666
↙ 111 222 333 444 555 666
← 111 222 333 444 555 666
↖ 111 222 333 444 555 666 (numeric values will change).
I use clipboard APIs to copy the data, just need help in generating the string.
Cheers,
John.
|
|
|
Post by Rod on Aug 4, 2019 11:21:33 GMT -5
|
|
|
Post by Rod on Aug 5, 2019 5:23:22 GMT -5
ASC v Unicode
I used Notepad to create a simple file with "Hello>end" the > being right arrow. Notepad allows Unicode characters I cut and pasted the arrow shown in your post.
I then saved the file as ASC and also as Unicode. This is the ASC print of both files.
ASC File 72 101 108 108 111 13 10 63 13 10 101 110 100
Unicode file 255 254 72 0 101 0 108 0 108 0 111 0 13 0 10 0 152 33 13 0 10 0 101 0 110 0 100 0
So you would need to create an ASC string mimicking Unicode string. If I CtrlC and CtrlV into Excel I get the arrow character. What might get in the way is the API call it may balk at the "0" in the file as it sees that as an ASC string terminator. There might be a version of the API that will cope with Unicode. MSDN will answer that.
|
|
|
Post by johnnyd on Aug 5, 2019 8:18:07 GMT -5
Hi Rod & cheers for the reply & help.
I had a flash of inspiration after seeing a clipboard viewer program, so downloaded one, copied the contents of a Word file containing the format I need and looked at the Unicode info.
I then created a text string in the program to mimic this and et voila - it worked!
There was one change to make to the API call to tell the clipboard to be Unicode which deals with the chr$(0)'s
I'm now happy.
John.
|
|