![]() |
|
#1
|
|||
|
|||
![]()
Thanks in advance,
I use the copy and paste keywords in VBA code, and at times I get a message "Recording clipboard style sheet will require copying many styles. Do you want to use normal styles instead?" This message box stops my code asking me to choose yes or no. Well, I want to keep the styles being pasted and I wish this message would not interrupt my code. Any way to avoid this message? ![]() |
#2
|
|||
|
|||
![]()
I can't produce that (I must not be trying to copy enough styles). Have you tried:
Application.DisplayAlerts=wdAlertsNone |
#3
|
|||
|
|||
![]()
Thank you so much, Application.DisplayAlerts=wdAlertsNone works great.
![]() |
#4
|
|||
|
|||
![]()
In practice you might want to:
Dim lngOpt as Long lngOpt = Appilcation.DisplayAlerts Application.DisplayAlerts = wdAlertsNone 'Do the deed Application.DisplayAlerts = lngOpt |
#5
|
|||
|
|||
![]()
I love your approach and really thought that it would solve my problem.
I have a feeling I'm not going to like the answer, but I'm going to ask the question anyway, just in case. When I paste, I answer No - I don't want to use Normal. Turning off DisplayAlerts gets rid of the annoying prompt, but seems to answer with the default Yes - I do want to use Normal So the question is, is there any way to modify this so that it doesn't use normal? I'm guessing any answer would have to involve SendKeys or something. Thanks! |
#6
|
|||
|
|||
![]()
Using paste in my VBA code depends on how much I am pasting. If the amount of text you are pasting is relatively small, this approach works well and does not apply the normal formatting. However, when I paste a large amount of text, the answer seems to be yes. Seems this approach works to protect against crashing the system with too much formatting.
Best always |
#7
|
|||
|
|||
![]() Quote:
I'm copying from the web page output of a system that's being developed for my company. The amount of text can vary. Worst case, so far, is copying ~1600 lines of data from three web pages of output - total about 5,000 lines. That's worst case. Most are only a few hundred lines. And I need the formatting to evaluate the output. They've just upgraded idea to Office 2013. Pasting directly into Excel has become so painfully slow, but I discovered that pasting into Word, cutting, then pasting into Excel is rather quick. And there are these annoying notifications. I've not had any problem with system crashes while doing this. And this is a stop-gap measure during the evaluation. Eventually it will email us reports, but until this is enabled, I'm doing the copy / paste bit. So, if there's any way to automate pasting in Word with formatting, that would be great. Thanks, Frank |
#8
|
||||
|
||||
![]()
If you're trying to replicate content, including formatting, you should consider using the .FormattedText method (I've made posts here using it) instead of Copy/Paste. Conversely, if you're trying to replicate text without formatting, you can use the .Text, .InsertAfter or .InsertBefore methods instead of Copy/Paste.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#9
|
|||
|
|||
![]()
Hi, same problem here.
I'd like to use FormattedText but I need to paste text and tables from multiple sources, not just a single file, to one document. Is there a way to do so? Thanks in advance. |
#10
|
||||
|
||||
![]()
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#11
|
|||
|
|||
![]()
Thanks a lot!
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
qrcode | Word | 3 | 05-26-2015 06:38 AM |
![]() |
rsrasc | Word VBA | 6 | 04-01-2014 03:42 PM |
Paste to a series of boxes with one paste? | BudVitoff | Misc | 0 | 11-27-2013 02:51 PM |
![]() |
tinfanide | Word | 6 | 03-06-2013 12:21 AM |
![]() |
averagejoe | Word | 2 | 03-13-2012 05:40 PM |