J
Janice
Hi - I've tried for two days to make this work, can you
help?
I need to "assemble" a document based on paragraphs of
text I have stored in documents. I'm using the insert
file feature to do this. The problem I'm having is I need
it to keep prompting for a doc name (which is a number)
until I type "9999" which will signal the end of the
loop. Here's my code, I've deleted my loopy mess. Thanks!
Sub InsertParas()
'
Dim pName As String
pName = InputBox("Enter filename")
If Len(pName) > 0 Then
Selection.InsertFile FileName:="c:/willform/0000" &
pName
Selection.EndKey unit:=wdStory
' (ok, now ask me again for another pname)
End If
' (ok, end the whole thing if I type "9999")
If pName = ("99999") Then
Exit Sub
End If
End Sub
help?
I need to "assemble" a document based on paragraphs of
text I have stored in documents. I'm using the insert
file feature to do this. The problem I'm having is I need
it to keep prompting for a doc name (which is a number)
until I type "9999" which will signal the end of the
loop. Here's my code, I've deleted my loopy mess. Thanks!
Sub InsertParas()
'
Dim pName As String
pName = InputBox("Enter filename")
If Len(pName) > 0 Then
Selection.InsertFile FileName:="c:/willform/0000" &
pName
Selection.EndKey unit:=wdStory
' (ok, now ask me again for another pname)
End If
' (ok, end the whole thing if I type "9999")
If pName = ("99999") Then
Exit Sub
End If
End Sub