PauloCastelo
New Member
- Joined
- Jul 7, 2016
- Messages
- 14
Hi people,
I'm trying to copy formatted text from Microsoft Word .doc but it isn't works.
I did using the code below:
I'm trying to copy formatted text from Microsoft Word .doc but it isn't works.
I did using the code below:
Code:
[I]' Extract text[/I]
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Dim objWord As New Word.Application
Dim objDoc As New Word.Document
Dim DocFile As String
DocFile = "C:\DocFiles.doc"
Dim strPath As Variant
strPath = DocFile
Set objDoc = objWord.Documents.Open(DocFile)
StrTemp = objDoc.Range(0, objDoc.Range.End)
[I]'Insert text[/I]
Sheets("Destination").Select
ActiveCell.Value = StrTemp
objDoc.Close savechanges:=wdDoNotSaveChanges