![]() |
#1
|
|||
|
|||
![]()
I am trying to use VBA for many repetitive tasks performed by our organization. One of those involves copying and then pasting in text, and then processing that pasted-in text.
The text that we would be copying looks like this: 1. Some text (multiple lines of text, wherein only the first line is numbered)...We use Word Styles for this: - The numbered paragraphs are one style - The non-numbered paragraphs that follow the numbered paragraphs are a different style. Manually performing this, I typically copy this text, then use a program called Pure Text, which essentially operates as Notepad does: That is, the "1.", "2." that begin the first lines are included. Thus, when I manually paste this in (using a keystroke devoted to Pure Text), the numbers are there. (I could copy, paste into Notepad, copy all, then paste into Word and get the same result.) Trying to implement this in VBA, however, if I perform a Paste Special, then Text Only, the numbers are not there. In VBA, this is what I am using: Selection.PasteSpecial Link:=False, DataType:=wdPasteText, Placement:= _This does not paste in the numbers ("1.", "2."...). Using VBA, is there a way to paste in a way that acts like Notepad does? If that is not possible, is it possible to access the clipboard (I assume this is where the text is stored before pasting it?) and then get those numbers or otherwise process what is in the clipboard so that I can retain those numbers? Ideally, I would not use text and would instead convert from one Word style to another. However, not everyone uses the same styles, and I'm concerned the level of programming it would take to operate with different styles would be too complex. Thank you. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Notepad to Word : Pasting Specific text ie between any two blank line from notepad to word | SMehta | Word VBA | 27 | 02-03-2021 03:34 AM |
![]() |
JohnTurnbull | Word | 5 | 08-27-2017 11:17 PM |
need a shortcut for paste special link unformatted text | noetic76 | Word VBA | 2 | 06-29-2014 06:40 PM |
![]() |
tinfanide | Word | 6 | 03-06-2013 12:21 AM |
![]() |
kenwpaul | Office | 2 | 02-25-2011 04:53 PM |