![]() |
|
#5
|
||||
|
||||
|
Quote:
Code:
Public Sub msWord_Structure()
Dim wdApp As Object, wdDoc As Object, wdTbl As Object, wdRng As Object, chqNobold As String, StrTxt As String
Dim custNameLen As Long, RefAcNoLen As Long, chqNoLen As Long, MyContactNosLen As Long
Const wdCollapseEnd As Long = 0
Const wdAlignParagraphCenter As Long = 1
Const wdAlignParagraphJustify As Long = 3
chqNobold = txtChqNo.Text
custNameLen = (17 + Len(cmbMyCustName.Text))
RefAcNoLen = (14 + Len(txtRefAcNo.Text))
chqNoLen = (11 + Len(chqNobold))
MyContactNosLen = (11 + Len(txtMyContactNos.Text))
StrTxt = vbCr & "Time " & txtTime.Text & vbCr & vbCr & _
"Customer Name : " & cmbMyCustName.Text & vbCr & vbCr & _
"Account No. " & txtRefAcNo.Text & " Chq No. " & txtChqNo.Text & vbCr & vbCr & _
"Mobile No" & txtMyContactNos.Text & " Tel No." & vbCr & vbCr & _
"Address of Remitter (Mandatory for Non IDBI Bank Customer)___________________________________" & vbCr & vbCr & _
"__________________________________________" & " Email ID ______________________________________________" & vbCr & vbCr & _
vbCr & vbCr & " Incase of NonIDBI Bank Customer Amount of Cash Deposited _____________________________________" & vbCr & vbCr '& " Beneficiary Details :"
On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If Err Then Set wdApp = CreateObject("Word.Application")
On Error GoTo 0
wdApp.Visible = True
Set wdDoc = wdApp.Documents.Add
With wdDoc.Range
.Font.Name = "Tahoma"
.Font.Size = 12
.Paragraphs.SpaceAfter = 0
.ParagraphFormat.Alignment = wdAlignParagraphJustify
.Text = "RTGS/ Request Form" & vbCrLf & vbCrLf & _
Chr(144) & "RTGS " & Chr(144) & "" & _
vbCrLf & vbCrLf & "For RTGS" & vbCr
With .Paragraphs(1).Range
.Font.Size = 16
.Font.Underline = True
.ParagraphFormat.Alignment = wdAlignParagraphCenter
End With
.Paragraphs.Last.Previous.Range.Font.Underline = True
Set wdTbl = .Tables.Add(.Characters.Last, 4, 2)
With wdTbl
.Columns(1).Width = 300
.Columns(2).Width = 130
.Borders.Enable = True
.Rows.HorizontalPosition = 5
.Rows.VerticalPosition = 10
With .Cell(1, 1)
.Merge wdTbl.Cell(1, 2)
.Range.Text = "Maximum Limit For Transaction"
.Range.ParagraphFormat.Alignment = wdAlignParagraphCenter
End With
With .Cell(2, 1).Range
.Text = "IDBI Bank Customer"
.ParagraphFormat.Alignment = wdAlignParagraphJustify
End With
With .Cell(2, 2).Range
.Text = "No Limit"
.ParagraphFormat.Alignment = wdAlignParagraphJustify
End With
With .Cell(3, 1).Range
.Text = "Non IDBI Bank Customer & Indo Nepal Remittance"
.ParagraphFormat.Alignment = 3
End With
With .Cell(3, 2).Range
.Text = "Up to INR 50,000/-"
.ParagraphFormat.Alignment = wdAlignParagraphJustify
End With
With .Cell(4, 1).Range
.Text = "Purpose of Remittance to Nepal - Family Maintenance only"
.ParagraphFormat.Alignment = wdAlignParagraphJustify
End With
With .Cell(4, 2).Range
.Text = "Yes / No"
.ParagraphFormat.Alignment = wdAlignParagraphJustify
End With
End With
.InsertAfter StrTxt
Set wdRng = .Paragraphs(18).Range
With wdRng
.Start = .Start + 5
.End = .End - 1
.Font.Bold = True
End With
End With
End Sub
Quote:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
How do I create an index of every word in a document?
|
jbengal | Word | 5 | 11-23-2022 02:17 PM |
Can I create word wizards with Word 2016 to automate document creation?
|
OkiDoki | Word | 4 | 09-30-2016 11:41 AM |
Word 2010 - How to create a fillable document from a boilerplate document
|
sheaters | Word | 2 | 05-04-2016 01:57 PM |
| How to create a special TOC in word document? | gn4619 | Word VBA | 5 | 04-29-2015 04:25 PM |
| How to identify whether Word 2007 was used to create a document saved as Word 2003 | noviceatwork | Word | 0 | 03-08-2012 06:40 AM |