![]() |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#5
|
|||
|
|||
|
I figured it out, using a brute force method. I first re-ran the code by Chat GPT, but that was wrong. So, I looked at other code of mine and just went line by line through this, changing coding as necessary and running 10+ times, until I got what I wanted. Not pretty, but works.
Code:
newDoc.paragraphs(1).Range.InsertBefore Text:="Para1" & vbCr & vbCr
newDoc.paragraphs(2).Style = "StyleB"
newDoc.paragraphs(2).Range.InsertAfter Text:="Para2" & vbCr & vbCr
newDoc.paragraphs(4).Style = "StyleB"
newDoc.paragraphs(4).Range.InsertAfter Text:="Para3" & vbCr & vbCr
newDoc.paragraphs(6).Style = "StyleB"
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Get path of newly opened word document
|
MANOHAR | Word | 2 | 04-12-2017 06:07 AM |
| Hyperlinks that Do Not Exist in the Original Word Document Appearing in the PDF Document | diarrheaofthewprocessor | Word | 11 | 01-24-2017 01:52 PM |
| Single step Word Styles from Source Document through entire Destination document? | xbliss | Word | 6 | 08-27-2016 09:36 PM |
| Word 2013 - When deleting section breaks, cursor jumps to beginning of document | ranholmom66 | Word | 3 | 07-01-2016 06:01 AM |
Lost word document now opened in unknown
|
Danwordman | Word | 2 | 07-07-2015 05:03 AM |