By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,982 Members | 1,955 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,982 IT Pros & Developers. It's quick & easy.

how to move text repeatedly in 360+ Word documents without opening them

P: 24
Hello,

I have been asked to move a paragraph to a new location in over 360 Word documents. I was shocked to find out that changing an attached template will only affect documents produced from the template in the future. So it doesn't work like a style sheet, for example. But, I digress, my question is: is there a means in Visual Basic, or using a macro, or anything else that can help me automate this? I have no doubt the boss will ask for more moves in the future.

I am beginner to VB and VBA. I have googled and read docs and search through this site for a solution before asking. Thanks in advance for your help!
Apr 11 '07 #1
Share this Question
Share on Google+
2 Replies


Dököll
Expert 100+
P: 2,364
Hello,

I have been asked to move a paragraph to a new location in over 360 Word documents. I was shocked to find out that changing an attached template will only affect documents produced from the template in the future. So it doesn't work like a style sheet, for example. But, I digress, my question is: is there a means in Visual Basic, or using a macro, or anything else that can help me automate this? I have no doubt the boss will ask for more moves in the future.

I am beginner to VB and VBA. I have googled and read docs and search through this site for a solution before asking. Thanks in advance for your help!
Hello bbasberg!

Thinking ahead, good of you...

Can you tell us a little more? You will need a find and replace. I have a code that works for relacing similar words from a paragraph, but in your case, the paragraph would need to be a specific paragraph everytime.

Thank you for "searching before asking". Let me know if the code I refer to can be of use to you, perhaps you can mimmick at your linking.

I must update my notebook now, will post you an example in a bit...
Apr 14 '07 #2

Dököll
Expert 100+
P: 2,364
Hello bbasberg!

Thinking ahead, good of you...

Can you tell us a little more? You will need a find and replace. I have a code that works for relacing similar words from a paragraph, but in your case, the paragraph would need to be a specific paragraph everytime.

Thank you for "searching before asking". Let me know if the code I refer to can be of use to you, perhaps you can mimmick at your linking.

I must update my notebook now, will post you an example in a bit...
Alright, and again this will only work if you need to switch paragraphs and the paragraph within, being removed, provides the same text everytime. This is merely an idea:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim InputParagraph As String
  3. Dim ReplaceParagraph As String
  4. InputParagraph = "It rained everyday for months, but I thought, it cannot rain all the time.  Would you believe, it stopped raining.  Darn it, it stopped, and I laughed and laughed...My boss was overjoyed.  My Boss was simply estatic.  In fact, I got a promotion.  Patience counts and I deserve to pad myself on the back.  Pretty fancy eh!"
  5.  
  6.  
  7. ReplaceParagraph= "My Boss was simply estatic.  In fact, I got a promotion.  Patience counts and I deserve to pad myself on the back.  Pretty fancy eh!"
  8.  
  9.  
With thehelp of a Do While loop, in the additional code, the program loads ReplaceParagraph text elsewhere on its own. By the way, InputParagraph can be Text1.Text, a multiline Textbox where you'll add the block of text in which ReplaceParagraph will find the specifics to replace.

Let me know what you think. Again, please ignore this if this not where you are going. Post what you have, therefore, we'll find a workaround, something in that kind of a line.

In a bit!
Apr 14 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.