Title

Message

Confirm

<< DiscussionsReply

Pasting a multi line predefined text in 1 action.

Avatar from Gravatar.com
Leon André Bergman
60 discussion posts

Code


The above code shows how I put together the macro.
This opens a new page in onenote, and adds a title, and a list of items I want to have ready for noting down the calling customers information.

This is a slightly slower process than I would like, as it pastes one line, sends the enter, and pastes the next.

Is there a way for me to have it paste all the 5 lines simultaneously?

And in addition, I would like to add a timestamp of what hour and minute the customer called, in the title of the new page. Is there a code to add this? I found that you can search and only paste time or date from the text you copy, but I haven't found if you can add the current time.
Nov 1, 2017  • #1
Thomas Malloch (BFS)'s profile on WallpaperFusion.com
You can easily get ClipboardFusion to paste more than one line at a time by using the "\n" (newline) character in your code. Here's an example:

Code



When this pastes, it should look like:

Customer Number:
Customer Name:

I hope this works for you!
Nov 1, 2017  • #2
Avatar from Gravatar.com
UWK-87
164 discussion posts
@Leon André Bergman: I think you made it too complex with enter key strokes. Why not keep it simple
P.S: Didn't change the code which was handling your application.
P.P.S: The code also print an extra line with time of customer call

For ease of understanding, I am attaching the cfmacro file with this post. Just import it

Code

• Attachment: New One Note - Note.cfmacro [1,240 bytes]
Nov 1, 2017 (modified Nov 1, 2017)  • #3
Avatar from Gravatar.com
Leon André Bergman
60 discussion posts
Thank you guys. I might have made it complicated, but only because this is the first time I have had anything to do with C# or coding.

EDIT: UWK-87: Your changes ended up not working for me.
It created a new pace, and added the title, like I wanted.
But nothing happened with your code. I didn't get anything after it jumped down from the title.

Thomas Malloch: Thank you. The \n worked like a charm.
The only thing I need now, is to get the current time in the title, directly behind where it says Company.
Like I said. I'm new to this coding stuff, so I will probably ask for more advice, but this is really shaping up to be a good replacement.
Nov 1, 2017 (modified Nov 1, 2017)  • #4
Avatar from Gravatar.com
UWK-87
164 discussion posts
Hi Leon

There was a small mistake Try now

Code

• Attachment: New Note.cfmacro [8,272 bytes]
Nov 1, 2017  • #5
Avatar from Gravatar.com
UWK-87
164 discussion posts
Lastly, where do you want the time to be pasted?
Nov 1, 2017  • #6
Avatar from Gravatar.com
Leon André Bergman
60 discussion posts
I want it to be pasted at the end of my title, so directly after Company.
I changed your code slightly, and it now ends up in the title:

Code



The only problems I face now, is that it does not show it with a 24 hour time format, and I get . instead of : as separators.
Nov 1, 2017 (modified Nov 1, 2017)  • #7
Avatar from Gravatar.com
UWK-87
164 discussion posts
Did the new code work for you?
Nov 1, 2017  • #8
Avatar from Gravatar.com
UWK-87
164 discussion posts
Here is the modified code for time in the title. Also cfmacro file attached for ease of import.

Code

• Attachment: New Note - With Time in Title.cfmacro [8,328 bytes]
Nov 1, 2017  • #9
Avatar from Gravatar.com
Leon André Bergman
60 discussion posts
Same thing I did. hehe. Yea, it works, but I don't use am/pm, I use a 24 hour clock, so I googled it and found that I need to put upper case HH to get 24 hour time. Nice.
Bothers me that the output is with a period as a separator, and not a colon though.
Any idea why that happens?
Nov 1, 2017  • #10
Avatar from Gravatar.com
UWK-87
164 discussion posts
yeh saw your post later.

I get this output when I execute it


Do you get something else?
Nov 1, 2017  • #11
Avatar from Gravatar.com
Leon André Bergman
60 discussion posts
After changing to 24 hour clock, and removing the seconds, I get this. Attached

EDIT: Never mind. That was a windows setting. Fixed it.
• Attachment: Capture.PNG [7,634 bytes]
Capture.PNG
Capture.PNG
Nov 1, 2017 (modified Nov 1, 2017)  • #12
Avatar from Gravatar.com
UWK-87
164 discussion posts
For me it works fine with the changes.



I don't think that is the issue of the code anymore. I highlighted the system time in my image. If you look at the system time in your One Note sheet, it is with ".". I am guessing here but you need to change the time and date display settings from Control Panel-> Region -> Change date, time, or number formats. Again this is a guess, hope it helps.
Nov 1, 2017 (modified Nov 1, 2017)  • #13
Avatar from Gravatar.com
Leon André Bergman
60 discussion posts
Yes. In my edit, I said I found it as the system time was incorrectly formated. It's been changed now. Never noticed that until now. At work it should be fine.
Thank you for all your help. This will surely excel my skills in C# in the time going forward.
Nov 1, 2017  • #14
Avatar from Gravatar.com
UWK-87
164 discussion posts
Hehe didn't see the edit.
You welcome
Nov 1, 2017  • #15
Was this helpful?    
<< DiscussionsReply