Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-09-2014, 12:29 PM
Mihail Mihail is offline Just MS Word Windows XP Just MS Word Office 2007
Novice
Just MS Word
 
Join Date: Apr 2012
Posts: 6
Mihail is on a distinguished road
Default Just MS Word

Hello to every one and
HAPPY NEW YEAR !

Can you, please, take a look to this thread ?
http://www.access-programmers.co.uk/...43#post1321143



maybe you can help me somehow ?!

Thank you.
Reply With Quote
  #2  
Old 01-09-2014, 02:58 PM
macropod's Avatar
macropod macropod is offline Just MS Word Windows 7 32bit Just MS Word Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,369
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

See: https://www.msofficeforums.com/word/...html#post32524
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 01-09-2014, 04:05 PM
Mihail Mihail is offline Just MS Word Windows XP Just MS Word Office 2007
Novice
Just MS Word
 
Join Date: Apr 2012
Posts: 6
Mihail is on a distinguished road
Default

Hi Paul.
Thank you very much for the code.

Can you help me a bit more please ?

I uploaded a document (Word 2007) that contain what I copied from www.
If I run first my code then your code (the last part), all seems to be OK.

But, in order to fully automatize that I need a condition to escape from my last Do-Loop.
While I have no idea about Word's objects, I have no chance to do this on my own.

Thank you.
Attached Files
File Type: zip Macros.zip (236.5 KB, 9 views)
Reply With Quote
  #4  
Old 01-09-2014, 04:33 PM
macropod's Avatar
macropod macropod is offline Just MS Word Windows 7 32bit Just MS Word Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,369
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

As can be seen from the code in the link I posted, all of your requirements can be met with a straightforward Find/Replace macro without the need to introduce the complications of function calls and looping. Indeed, you shouldn't need both macros - mine can handle the whole task on its own and is somewhat more sophisticated than what you now have and is much more efficient. Unlike yours, mine also doesn't change the selected range.

As to the looping issue with your code, you should be able to resolve that by changing:
.Wrap = wdFindContinue
to:
.Wrap = wdFindStop
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 01-10-2014, 04:37 AM
Mihail Mihail is offline Just MS Word Windows XP Just MS Word Office 2007
Novice
Just MS Word
 
Join Date: Apr 2012
Posts: 6
Mihail is on a distinguished road
Default

Thank you for the help, Paul.

Of course that I tried your macro on my document (as it is) but I didn't obtain the desired results because

I need to eliminate the manual line break(s) and your macro don't do this.
More, it transform my text in something unreadable. Do a try, please, and see what I speaking about.

And, again, I am not able to tweak this because I have no idea (yet ) about VBA for word.

About the last code you give me, I'll try to implement it.
Where ? Hope I'll be able to understand.

Thank you again.
Reply With Quote
  #6  
Old 01-10-2014, 04:51 AM
macropod's Avatar
macropod macropod is offline Just MS Word Windows 7 32bit Just MS Word Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,369
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 Mihail View Post
I need to eliminate the manual line break(s) and your macro don't do this.
That's easily remedied by inserting:
Code:
  'Replace manual line breaks with paragraph breaks
  .Text = "[^]{1,}"
  .Replacement.Text = "^p"
  .Execute Replace:=wdReplaceAll
before:
Code:
  'Replace single paragraph breaks with a space
Quote:
More, it transform my text in something unreadable.
Did you read the caveat in the link about the basic format requirements of the text to be converted? Does your text conform?
Quote:
About the last code you give me, I'll try to implement it.
Where ? Hope I'll be able to understand.
Surely you can at least read your own code, even if you don't understand it...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 01-10-2014, 08:45 AM
Mihail Mihail is offline Just MS Word Windows XP Just MS Word Office 2007
Novice
Just MS Word
 
Join Date: Apr 2012
Posts: 6
Mihail is on a distinguished road
Default

@Paul
Quote:
Did you read the caveat in the link about the basic format requirements of the text to be converted?
Yes. But seems that I don't understand very well

Quote:
Surely you can at least read your own code, even if you don't understand it...
It isn't my code, Paul. It is the Word's code after I recorded a macro.
I don't understand a lot of stuff here, and, for sure, a lot of this code is unnecessary, but I am not able, based on my skills on VBA for Word, to make a decision.

Anyway, with your huge help, I got it to work.

Thank you very much !


Anyone can see the "solution" here:
http://www.access-programmers.co.uk/...d.php?t=259250

Thank you one more time !

All the bests !
Reply With Quote
Reply



Other Forums: Access Forums

All times are GMT -7. The time now is 10:22 AM.


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