The following code copies whatever text is selected then adds it to a newly-created Word doc, removes numbering (as in bullet numbering) and then replaces what is on the clipboard with the modified text. It works fine when Word isn't already open. However if Word is already open it works fine the first time but after that the content of the clipboard isn't changed. Can anybody tell me why?
vb Code:
SendKeys "^c", True With wdApp .Documents.Add , , wdNewBlankDocument, True .Documents(1).Activate DoEvents .Selection.PasteAndFormat wdPasteDefault .Selection.WholeStory .Selection.Range.ListFormat.RemoveNumbers NumberType:=wdNumberParagraph .Selection.Copy .Documents(1).Close SaveChanges:=wdDoNotSaveChanges If .Documents.Count = 0 Then .Quit Set wdApp = Nothing End If




Reply With Quote