mbbx5va2
03-23-2014, 01:30 PM
Hi
I am trying to insert a text box in the word document so that I can write an address so that the word document is in letter format. Also I want to put the data into 3 separate tables. I can do this in word but wanted to know how to amend the code below to create the letter output. If anyone can amend the data below and put any of it inside a text box with edges colored white or inside a table then that should be enough.
Using the following code I have created the attached word document:
'Send commands to Word With WordApp
.Documents.Add
With .Selection
.Font.Size = 14
.Font.Bold = True
.ParagraphFormat.Alignment = 1
.TypeText Text:="ULFP project lead sheet"
.TypeParagraph
.TypeParagraph
.Font.Size = 12
.ParagraphFormat.Alignment = 0
.Font.Bold = False
.TypeText Text:="Date:" & vbTab & _
Format(Date, "mmmm d, yyyy")
.TypeParagraph
.TypeText Text:="Policy Number:" & vbTab & Region
.TypeParagraph
.TypeText Text:="ID: VA78747"
.TypeParagraph
.TypeText Text:="Surnames:" & vbTab & Surname
.TypeParagraph
.TypeParagraph
.TypeParagraph
.TypeText Text:="Remediation Amount:" & vbTab & Remediation
.TypeParagraph
.TypeText Text:="Interest:" & vbTab & Inte
.TypeParagraph
.TypeText Text:="Taxation:" & vbTab & Ta
.TypeParagraph
.TypeText Text:="Total Remediation Amount:" & vbTab & TotalRem
.TypeParagraph
.TypeParagraph
.TypeParagraph
.TypeText Text:="Transaction type:" & vbTab & "Cheque"
.TypeParagraph
.TypeText Text:="Payee Name:" & vbTab & Pay
.TypeParagraph
End With
Any thoughts? :think:
I am trying to insert a text box in the word document so that I can write an address so that the word document is in letter format. Also I want to put the data into 3 separate tables. I can do this in word but wanted to know how to amend the code below to create the letter output. If anyone can amend the data below and put any of it inside a text box with edges colored white or inside a table then that should be enough.
Using the following code I have created the attached word document:
'Send commands to Word With WordApp
.Documents.Add
With .Selection
.Font.Size = 14
.Font.Bold = True
.ParagraphFormat.Alignment = 1
.TypeText Text:="ULFP project lead sheet"
.TypeParagraph
.TypeParagraph
.Font.Size = 12
.ParagraphFormat.Alignment = 0
.Font.Bold = False
.TypeText Text:="Date:" & vbTab & _
Format(Date, "mmmm d, yyyy")
.TypeParagraph
.TypeText Text:="Policy Number:" & vbTab & Region
.TypeParagraph
.TypeText Text:="ID: VA78747"
.TypeParagraph
.TypeText Text:="Surnames:" & vbTab & Surname
.TypeParagraph
.TypeParagraph
.TypeParagraph
.TypeText Text:="Remediation Amount:" & vbTab & Remediation
.TypeParagraph
.TypeText Text:="Interest:" & vbTab & Inte
.TypeParagraph
.TypeText Text:="Taxation:" & vbTab & Ta
.TypeParagraph
.TypeText Text:="Total Remediation Amount:" & vbTab & TotalRem
.TypeParagraph
.TypeParagraph
.TypeParagraph
.TypeText Text:="Transaction type:" & vbTab & "Cheque"
.TypeParagraph
.TypeText Text:="Payee Name:" & vbTab & Pay
.TypeParagraph
End With
Any thoughts? :think: