Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-06-2020, 07:43 PM
macropod's Avatar
macropod macropod is offline Create a Word Document with VBA Windows 7 64bit Create a Word Document with VBA 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
  #2  
Old 03-08-2020, 04:02 AM
SamDsouza SamDsouza is offline Create a Word Document with VBA Windows 10 Create a Word Document with VBA Office 2013
Advanced Beginner
Create a Word Document with VBA
 
Join Date: Aug 2019
Posts: 71
SamDsouza is on a distinguished road
Default

Thank you sir, for your coding. Lastly i would like to ask you how could i add a Footer note after the above range. FYI this should display in Left of footer note.
And a small image if i could insert at Right at Footer note.

i tried using active document but could not set its refernce

Quote:
All of this coding would be quite unnecessary if you used a template...
you are right. this point is well taken and will take care.
SamD
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a Word Document with VBA How do I create an index of every word in a document? jbengal Word 5 11-23-2022 02:17 PM
Create a Word Document with VBA Can I create word wizards with Word 2016 to automate document creation? OkiDoki Word 4 09-30-2016 11:41 AM
Create a Word Document with VBA 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

Other Forums: Access Forums

All times are GMT -7. The time now is 11:28 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft