PDA

View Full Version : Import Word text to Access



boneKrusher
02-20-2006, 12:45 PM
Hi All,
I am trying to import a word doc into access. The following code only returns the first letter of the document. I want to be able to import the whole doc into the text box....any help would be great..

Dim wdtext As String
Dim objapp As Object
Dim objWord As Object
Set objWord = CreateObject("Word.Application")
objWord.Documents.Add ("C:\temp\list.doc")
objWord.Visible = True 'True is visible
With objWord.Selection
wdtext = objWord.Selection.Text
End With

Me.Text1 = objWord.Selection

matthewspatrick
02-20-2006, 02:12 PM
With objWord.Selection
.Expand 6 '6=wdStory
wdtext = .Text
End With

boneKrusher
02-20-2006, 02:47 PM
thanks!