View Single Post
 
Old 03-06-2020, 07:43 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by SamDsouza View Post
Thank you Sir,

Where are the changes you made to the code ?
Quite obviously, I've changed the paragraph reference from 17 to 18.
Quote:
Originally Posted by SamDsouza View Post
Quote:
Question 2 : What is the Criteria to be considered For a Paragraph number or its index number with Lines and Tables and cells inside the table
if you could throw some hilite on the above question
Paragraphs within a table can be referenced by their cell address. Indexing is the same as elsewhere.
Quote:
Originally Posted by SamDsouza View Post
and also What if there is another text box reference in paragraph #18 for eg but goes in next line How to get its reference ?
There is nothing in your code that refers to a textbox in the document, so I don't know what you mean. That said, if instead of:
Code:
StrTxt = vbCr & "Time " & txtTime.Text & vbCr & vbCr & _
  "Customer Name : " & cmbMyCustName.Text & vbCr & vbCr & _
  "Account No. " & txtRefAcNo.Text & " Chq No. " & txtChqNo.Text & vbCr & vbCr
you used something like:
Code:
StrTxt = vbCr & "Time : " & txtTime.Text & vbCr & vbCr & _
  "Customer Name : " & cmbMyCustName.Text & vbCr & vbCr & _
  "Account No. : " & txtRefAcNo.Text & " Chq No. : " & txtChqNo.Text & vbCr & vbCr
You could use the Instr and IntrRev functions to find the ':' characters for use as offsets. For example:
Code:
  With wdRng
    .Start = .Start + InStr(.Text, ":") + 1
    .End = .End - 1
    .Font.Bold = True
  End With
All of this coding would be quite unnecessary if you used a template...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote