![]() |
|
#1
|
|||
|
|||
|
Hello all members. I need some help/or ready solution for my problem.
There is ms word document with somethin' data. I need clean all data from document and paste my text or data in that doc with vba macros. I alredy have some solution but workn't with big document(50-60 pages) and not delete any data exclude text : Code:
Sub CleanData()
Dim curCharIndex As Integer
Dim charCount As Integer
curCharIndex = 1
charCount = ActiveDocument.Characters.Count
While curCharIndex <= charCount
ActiveDocument.Characters(curCharIndex).Select
If Selection.Type = wdSelectionNormal Then
Selection.Delete
charCount = charCount - 1
Else
'Skip it
curCharIndex = curCharIndex + 1
End If
Wend
End Sub
Maybe there is any way emulate marking all text(Ctrl+A) and delete that text(by DEL button) from word document not so dirty like my solution. I'm sorry for my poor english. Thanx, with best regards, egyp7
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
VBA Code to take data from a table in word document and place it in a summary table
|
VBLearner | Word VBA | 1 | 03-09-2014 08:42 PM |
| importing Access data to a Word document | WayneCusack | Word VBA | 2 | 12-24-2012 12:26 AM |
Help Plz! Link Excel data to Word document
|
cory_0101 | Office | 1 | 09-27-2012 07:15 PM |
How do you view the source code in a Word 10 web document?
|
provlima | Word | 2 | 05-25-2012 01:12 PM |
Error Code 5453 Word has finished searching the document
|
Charles Kenyon | Word VBA | 2 | 05-17-2012 11:18 AM |