K
Kyle
Can anyone tell me why this code does not work. I've tried so many
methods of automatically adding a couple hundred items from a Word
document as tasks. Any help would be greatly appreciated. Thanks
Kyle
-----------------------------------------------------------
Dim objWord As Word.Application
Dim objDoc As Word.Document
Dim strParagraph As String
Dim i As Integer
Dim oTask As Task
Set objWord = CreateObject("word.application")
Set objDoc = GetObject("C:\Documents and
Settings\username\Desktop\11.doc")
For i = 1 To objDoc.Paragraphs.Count
strParagraph = Replace(objDoc.Paragraphs(i).Range.Text,
Chr$(9), " ")
Set oTask = ActiveProject.Tasks.Add
oTask.SetField "Name", strParagraph
Next i
If Not (objWord Is Nothing) Then Set objWord = Nothing
If Not (objDoc Is Nothing) Then Set objDoc = Nothing
End Sub
methods of automatically adding a couple hundred items from a Word
document as tasks. Any help would be greatly appreciated. Thanks
Kyle
-----------------------------------------------------------
Dim objWord As Word.Application
Dim objDoc As Word.Document
Dim strParagraph As String
Dim i As Integer
Dim oTask As Task
Set objWord = CreateObject("word.application")
Set objDoc = GetObject("C:\Documents and
Settings\username\Desktop\11.doc")
For i = 1 To objDoc.Paragraphs.Count
strParagraph = Replace(objDoc.Paragraphs(i).Range.Text,
Chr$(9), " ")
Set oTask = ActiveProject.Tasks.Add
oTask.SetField "Name", strParagraph
Next i
If Not (objWord Is Nothing) Then Set objWord = Nothing
If Not (objDoc Is Nothing) Then Set objDoc = Nothing
End Sub