Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 03-06-2020, 12:08 AM
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

The code I supplied is a complete unit - you can't just take part of it and paste it into your own code. The error you're now getting suggests your paragraph 17 is empty. In other words, you've specified the wrong paragraph. Check what paragraph:
Set wdRng = .Paragraphs(17).Range
actually points to. For example:
Set wdRng = .Paragraphs(17).Range
MsgBox wdRng.Text
Exit Sub
Does the message box give the expected text?
Quote:
Originally Posted by SamDsouza View Post
unfortunately the full structure has been modified with your coding. as in your coding the missing part is from txtHeader as per#1.
Not if you use the entire code I posted...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



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 06:18 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