PasteSpecial and Run-time error 4198

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15641
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

PasteSpecial and Run-time error 4198

Post by ChrisGreaves »

This is another one that's been puzzling me as I work through GoToMeeting to my client's machine and thence to his client's machine. (Sluggish mouse, my buddy jumping in without warning me, etc etc).
Sometimes the code works, sometimes it doesn't.
Cindy Meister had something to say about it.
As did Microsoft way back in the days of Word 97
I plan to go from this

Code: Select all

Sub CopySelectiontoPlainLabel()
    Selection.Copy
    Documents.Add Template:=ThisDocument.Path & "\" & "Plain Label Type 30323.dot", _
        NewTemplate:=False, DocumentType:=0
    Selection.PasteAndFormat wdFormatPlainText
End Sub
to this

Code: Select all

Sub CopySelectiontoPlainLabel()
    Selection.Copy
    Documents.Add Template:=ThisDocument.Path & "\" & "Plain Label Type 30323.dot", _
        NewTemplate:=False, DocumentType:=0
    DoEvents ' Fix PasteSpecial problem?
    Selection.PasteAndFormat wdFormatPlainText
End Sub
I'll report back after the next test.
mmc_009Small.png
You do not have the required permissions to view the files attached to this post.
He who plants a seed, plants life.