J
John Coon
I have a Autocad form for marking paint on a runway. what I'd like to do is
use the data from the form to create a QTO report in word.
This section of code launches word and places text into the word document.
The problem I have is that I don't know how to pass the
values from the form TextBoxes in Autocad into the insert text part in word.
This is my first attemp using word
Thank you for any direction you can give,
John Coon
sample TextBox Values:
TextBox7 = 150
TextBox8 = 5.75
Should print as "This is a test for a value from a textBox = 150 x 5.75"
'Pass TextBoxes from autocad
Private Sub CommandButton2_Click()
Hide
On Error GoTo errorHandler
Dim wdApp As Word.Application
Dim myDoc As Word.Document
Dim mywdRange As Word.Range
Set wdApp = New Word.Application
With wdApp
.Visible = True
.WindowState = wdWindowStateMaximize
End With
Set myDoc = wdApp.Documents.Add
Set mywdRange = myDoc.Words(1)
With mywdRange
.Text = "This is a test for a value from a textBox " & _
"value = TextBox7 x TextBox8"
.Font.Name = "Comic Sans MS"
.Font.Size = 12
.Font.ColorIndex = wdBlack
.Bold = True
End With
errorHandler:
Set wdApp = Nothing
Set myDoc = Nothing
Set mywdRange = Nothing
End Sub
use the data from the form to create a QTO report in word.
This section of code launches word and places text into the word document.
The problem I have is that I don't know how to pass the
values from the form TextBoxes in Autocad into the insert text part in word.
This is my first attemp using word
Thank you for any direction you can give,
John Coon
sample TextBox Values:
TextBox7 = 150
TextBox8 = 5.75
Should print as "This is a test for a value from a textBox = 150 x 5.75"
'Pass TextBoxes from autocad
Private Sub CommandButton2_Click()
Hide
On Error GoTo errorHandler
Dim wdApp As Word.Application
Dim myDoc As Word.Document
Dim mywdRange As Word.Range
Set wdApp = New Word.Application
With wdApp
.Visible = True
.WindowState = wdWindowStateMaximize
End With
Set myDoc = wdApp.Documents.Add
Set mywdRange = myDoc.Words(1)
With mywdRange
.Text = "This is a test for a value from a textBox " & _
"value = TextBox7 x TextBox8"
.Font.Name = "Comic Sans MS"
.Font.Size = 12
.Font.ColorIndex = wdBlack
.Bold = True
End With
errorHandler:
Set wdApp = Nothing
Set myDoc = Nothing
Set mywdRange = Nothing
End Sub