![]() |
|
#1
|
|||
|
|||
![]()
Sub Macro1()
' ' Macro1 Macro ' ' Selection.Cut Selection.TypeText Text:="{{c1::" Selection.PasteAndFormat (wdFormatPlainText) Selection.TypeText Text:="}}" Selection.TypeParagraph End Sub it fails at the pasting stage i tried the automatic paste and plainText paste but same failed result |
#2
|
||||
|
||||
![]()
Do you really want to lose fields, tables and graphics by pasting as plain text?
Perhaps another 'less destructive' way would be to remove formatting from the selection and insert text before and after it. Code:
Sub Macro1() With Selection .ParagraphFormat.Reset .Font.Reset .Range.Style = ActiveDocument.Styles(wdStyleNormal) .InsertAfter "}}" .InsertBefore "{{c1::" End With End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
![]() |
Tags |
macro |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
What's new in Word 2019, Excel 2019 and Outlook 2019 and Why upgrade to Office 2019 is recommended? | einfomail | Office | 0 | 07-25-2019 11:49 AM |
PgUp/PgDn not working as expected in Word 2019; macro workaround? | AmyJSchneider | Word VBA | 0 | 01-19-2019 03:45 PM |
![]() |
Katherine1995 | Word VBA | 6 | 11-17-2016 12:04 PM |
Word 2010 Run-Time error 4198 with Insert Picture with Caption and Fram Macro | jstills116 | Word VBA | 0 | 06-24-2016 07:46 AM |
Run time error - Pivot Cache Failed | patrick1063 | Excel Programming | 0 | 02-08-2016 07:56 PM |