TextBox Text

C

CY

Hi,

I have just inserted a simple textbox in Word.
The text box provides an avenue for me to type in the location of a textfile.
Textbox text would be C:\Temp\TEST in this case

Documents.Add
ChDir "C:\Temp\TEST"
myName = Dir("*.sum")
While myName <> ""
With Selection
Selection.TypeParagraph
.TypeText Text:="*******************************"
Selection.TypeParagraph
.TypeText Text:="Filename: " & myName
Selection.TypeParagraph
.TypeText Text:="*******************************"
Selection.TypeParagraph
Selection.TypeParagraph
.InsertFile FileName:=myName, ConfirmConversions:=False
.InsertParagraphAfter
.InsertBreak Type:=wdPageBreak
.Collapse Direction:=wdCollapseEnd
End With
myName = Dir()
Wend

Any help welcome
Cy
 
C

CY

CY said:
Hi,

I have just inserted a simple textbox in Word.
The text box provides an avenue for me to type in the location of a textfile.
Textbox text would be C:\Temp\TEST in this case

Documents.Add
ChDir "C:\Temp\TEST"
myName = Dir("*.sum")
While myName <> ""
With Selection
Selection.TypeParagraph
.TypeText Text:="*******************************"
Selection.TypeParagraph
.TypeText Text:="Filename: " & myName
Selection.TypeParagraph
.TypeText Text:="*******************************"
Selection.TypeParagraph
Selection.TypeParagraph
.InsertFile FileName:=myName, ConfirmConversions:=False
.InsertParagraphAfter
.InsertBreak Type:=wdPageBreak
.Collapse Direction:=wdCollapseEnd
End With
myName = Dir()
Wend

Any help welcome
Cy

The textbox is a simple useform.
 
D

Doug Robbins

I am not sure what the problem is.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
C

CY

i dont know how to declare the user form textbox value in the vba editor

do u know what commands i need to use???

i have declare fileloc and filetype as strings and textbox.value to no avail
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top