Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 08-13-2011, 04:06 AM
GJohansson GJohansson is offline automatic text formatting(justify) Windows 7 32bit automatic text formatting(justify) Office 2007
Novice
 
Join Date: Aug 2011
Posts: 17
GJohansson is on a distinguished road
Default


No this doesn't make what i want to do. I' m searching for a macro because i dont know how to do this. That takes the text beside style of heading 1 and style of heading 2, and justifying without loosing its space between heading 1 and 2, only inside text justifying.
I try this makro but, again changes the format of my document to the style of heading 1 or heading 2, depend on selection of text. Ok thanks, makropod.
Reply With Quote
  #17  
Old 08-13-2011, 04:17 AM
macropod's Avatar
macropod macropod is offline automatic text formatting(justify) Windows 7 64bit automatic text formatting(justify) Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Hi saints,
Quote:
I try this makro but, again changes the format of my document to the style of heading 1 or heading 2, depend on selection of text.
If you're using 'With Selection.Find' and selecting the range to process, what you're descrobing could only happen if you have some Heading 1/2 text selected at the start (or perhaps the end) of the range to be processed.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #18  
Old 08-13-2011, 04:47 AM
GJohansson GJohansson is offline automatic text formatting(justify) Windows 7 32bit automatic text formatting(justify) Office 2007
Novice
 
Join Date: Aug 2011
Posts: 17
GJohansson is on a distinguished road
Default Hi macropod

Quote:
Originally Posted by macropod View Post
Hi saints,

If you're using 'With Selection.Find' and selecting the range to process, what you're descrobing could only happen if you have some Heading 1/2 text selected at the start (or perhaps the end) of the range to be processed.
In the attached initial document i select the text between heading 1 and heading 2 then style, then choose text document with same format then run the macro and the solution be not expected. But even i choose, only the text between heading 1 and 2, the same again.
Reply With Quote
  #19  
Old 08-13-2011, 12:14 PM
rtcole rtcole is offline automatic text formatting(justify) Windows Vista automatic text formatting(justify) Office 2007
Novice
 
Join Date: Aug 2011
Posts: 3
rtcole is on a distinguished road
Question Thanks but still a problem

Thanks so much for the help. I have followed the copy and paste procedure, pasting the whole macro from the window above, and tried the macro. I get "Compile Error: Expected End Stub" and when I click help, I get:

"An End procedure statement must match the procedure in which it occurs. This error has the following cause and solution:
  • You used End Function or End Property to end a Sub procedure.Use End Sub for this type of procedure"
It seems that the macro does have "End Sub" so what do I need to do?
Reply With Quote
  #20  
Old 08-13-2011, 06:56 PM
macropod's Avatar
macropod macropod is offline automatic text formatting(justify) Windows 7 64bit automatic text formatting(justify) Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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 rtcole View Post
Thanks so much for the help. I have followed the copy and paste procedure, pasting the whole macro from the window above, and tried the macro. I get "Compile Error: Expected End Stub" and when I click help, I get:

"An End procedure statement must match the procedure in which it occurs. This error has the following cause and solution:
  • You used End Function or End Property to end a Sub procedure.Use End Sub for this type of procedure"
It seems that the macro does have "End Sub" so what do I need to do?
Are you sure you copied & pasted the whole macro - it certainly inlcudes the 'End Sub' statement! Also, no-one else has reported this error, which suggests the problem is at your end.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #21  
Old 08-24-2011, 03:47 AM
GJohansson GJohansson is offline automatic text formatting(justify) Windows 7 32bit automatic text formatting(justify) Office 2007
Novice
 
Join Date: Aug 2011
Posts: 17
GJohansson is on a distinguished road
Default

Yes i think thats working nice. But how i can make it to select all text with same format and clean up text. In that way, that show to the second document i attached. In that way i must select manual all document text and apply the macro and next go to the second text, selected and apply the macro.
If i choose select style, with same format and apply the macro the macro dont work. I need more automation, any advice?
Reply With Quote
  #22  
Old 08-24-2011, 03:51 AM
GJohansson GJohansson is offline automatic text formatting(justify) Windows 7 32bit automatic text formatting(justify) Office 2007
Novice
 
Join Date: Aug 2011
Posts: 17
GJohansson is on a distinguished road
Default

Quote:
Originally Posted by saints View Post
Yes i think thats working nice. But how i can make it to select all text with same format and clean up text. In that way, that show to the second document i attached. In that way i must select manual all document text and apply the macro and next go to the second text, selected and apply the macro.
If i choose select style, with same format and apply the macro the macro dont work. I need more automation, any advice?
Why dont work the macro if i choose text between style 1 and style 2, and after choose text with same format?
Reply With Quote
  #23  
Old 08-24-2011, 06:28 AM
macropod's Avatar
macropod macropod is offline automatic text formatting(justify) Windows 7 64bit automatic text formatting(justify) Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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 saints View Post
Yes i think thats working nice. But how i can make it to select all text with same format and clean up text.
Without a lot of re-coding work, that's not going to happen.
Quote:
Originally Posted by saints View Post
If i choose select style, with same format and apply the macro the macro dont work. I need more automation, any advice?
What you could do, is use either the original or modified form of the macro (depending on whether you want the code to apply to the whole document or just a selected portion) and add the following:
.Style = "Normal" (or another style name of your choice)
before:
.Format = False
which you change to:
.Format = True

That should make to code reformat only the text in the nominated Style.

PS: I've got very limited internet access ATM, and won't be able to respond to further queries for around 10 days.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #24  
Old 08-24-2011, 07:30 AM
GJohansson GJohansson is offline automatic text formatting(justify) Windows 7 32bit automatic text formatting(justify) Office 2007
Novice
 
Join Date: Aug 2011
Posts: 17
GJohansson is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Without a lot of re-coding work, that's not going to happen.

What you could do, is use either the original or modified form of the macro (depending on whether you want the code to apply to the whole document or just a selected portion) and add the following:
.Style = "Normal" (or another style name of your choice)
before:
.Format = False
which you change to:
.Format = True

That should make to code reformat only the text in the nominated Style.

PS: I've got very limited internet access ATM, and won't be able to respond to further queries for around 10 days.
I ran it but gives me an error 5834, not find the clue with predifined name, i choose to debug and shows me an error at style, maybe we dont set the style in the form that word understand...
Reply With Quote
  #25  
Old 08-25-2011, 07:47 AM
GJohansson GJohansson is offline automatic text formatting(justify) Windows 7 32bit automatic text formatting(justify) Office 2007
Novice
 
Join Date: Aug 2011
Posts: 17
GJohansson is on a distinguished road
Default

Quote:
Originally Posted by saints View Post
I ran it but gives me an error 5834, not find the clue with predifined name, i choose to debug and shows me an error at style, maybe we dont set the style in the form that word understand...
Is there a way to fix this code to work, or with the use of wildcards that aply only in specific style of the document?
Reply With Quote
  #26  
Old 09-04-2011, 02:58 AM
macropod's Avatar
macropod macropod is offline automatic text formatting(justify) Windows 7 64bit automatic text formatting(justify) Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

What Style name did you use? Does that Style exist in your document? For me, the using the code as described I get no errors.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #27  
Old 09-05-2011, 01:01 PM
GJohansson GJohansson is offline automatic text formatting(justify) Windows 7 32bit automatic text formatting(justify) Office 2007
Novice
 
Join Date: Aug 2011
Posts: 17
GJohansson is on a distinguished road
Default Why dont work on me

Quote:
Originally Posted by macropod View Post
What Style name did you use? Does that Style exist in your document? For me, the using the code as described I get no errors.
I use this document, opened selected document, choose a text inside not heading, after that right click and choose styles, choose text with similar style, and after macros, and run the inside macro of the document which said that style is Normal, which give me run time error 5834.
Attached Files
File Type: doc This is the initial document.doc (13.7 KB, 7 views)
Reply With Quote
  #28  
Old 09-07-2011, 02:08 AM
GJohansson GJohansson is offline automatic text formatting(justify) Windows 7 32bit automatic text formatting(justify) Office 2007
Novice
 
Join Date: Aug 2011
Posts: 17
GJohansson is on a distinguished road
Default

Quote:
Originally Posted by saints View Post
I use this document, opened selected document, choose a text inside not heading, after that right click and choose styles, choose text with similar style, and after macros, and run the inside macro of the document which said that style is Normal, which give me run time error 5834.
if i use the office in other language than english, the style formats remain with the same names? example if use italian language the style is the same Normal, or need to change? Because the macro writes only in english. Where i can find the style that word uses to put inside? For me, doesnt working yet.
Reply With Quote
  #29  
Old 09-23-2011, 12:06 PM
GJohansson GJohansson is offline automatic text formatting(justify) Windows 7 32bit automatic text formatting(justify) Office 2007
Novice
 
Join Date: Aug 2011
Posts: 17
GJohansson is on a distinguished road
Default Trying almost a month but nothing happens

Quote:
Originally Posted by macropod View Post
What Style name did you use? Does that Style exist in your document? For me, the using the code as described I get no errors.
Im trying to find a solution... but not working for me....Any help...?
Reply With Quote
  #30  
Old 09-25-2011, 06:02 AM
GJohansson GJohansson is offline automatic text formatting(justify) Windows 7 32bit automatic text formatting(justify) Office 2007
Novice
 
Join Date: Aug 2011
Posts: 17
GJohansson is on a distinguished road
Default Style normal

Quote:
Originally Posted by saints View Post
Im trying to find a solution... but not working for me....Any help...?
i have put this macro in the initial document. And run it but nothing happens. What is wrong the macro dont justifing selected text of whole document automatic if this document has headings. Only if the document has the same format only. I put style normal but nothing happens. Yours working?
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic Formatting for whole row Bacchanal Promotions Excel 2 03-19-2011 05:12 AM
automatic text formatting(justify) Office 2007 Mail Merge Issue - automatic formatting and revisions balloons sharpie21 Office 1 10-10-2010 03:56 AM
Automatic insertion of blank pages or alternate text Diopippo Word 0 07-06-2010 12:13 AM
automatic text formatting(justify) problem with automatic formatting on quotation marks Bobosmite Word 3 05-27-2010 07:06 PM
Templates: automatic text generation from Rich Text content control Chickenmunga Word 0 10-01-2008 11:16 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:54 AM.


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