Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-15-2015, 10:57 AM
rsrasc rsrasc is offline Inserting Carriage Return Windows 7 64bit Inserting Carriage Return Office 2010 64bit
Competent Performer
Inserting Carriage Return
 
Join Date: Mar 2014
Location: Germany
Posts: 148
rsrasc is on a distinguished road
Default

Try your macro but did not work. Don't know why. I tried something different. The following code was given to me by "MACROPOD". This code was from a previous posting by changing the following code:



.Text = " ([a-e].)"

For:

.Text = " (Answer)"


HTML Code:
[PHP][/PHP]
Sub DemoAnswer()
Application.ScreenUpdating = False
With ActiveDocument.Range
  .InsertBefore " "
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchWildcards = True
    .Text = ".([0-9]{1,3}.)"
    .Replacement.Text = ". \1"
    .Execute Replace:=wdReplaceAll
    .Text = " (Answer)"
    .Replacement.Text = "^p\1"
    .Execute Replace:=wdReplaceAll
    .Replacement.Style = "Strong"
    .Text = " ([0-9]{1,3}.)"
    .Execute Replace:=wdReplaceAll
  End With
  .Characters.First.Delete
End With
Application.ScreenUpdating = True
End Sub

My intention when I asked for a code was to see if there was a way to insert a carriage return with a macro. With a little modification to the above macro I was able to get what I want.

Here is how the information looks before applying the macro:


1. (a) The requirement is to identify the categories of financial statement assertions. Answer (a) is correct because the professional standards establish financial statement assertions for account balances, classes of transactions and disclosures. Answer (b) is incorrect because financial statement assertions are established for disclosures. Answer (c) is incorrect because financial statement assertions are established for classes of transactions. Answer (d) is incorrect because financial statement assertions are established for both classes of transactions and disclosures.

Here is how the information looks after applying the macro (which I like):


1. (a) The requirement is to identify the categories of financial statement assertions.
Answer (a) is correct because the professional standards establish financial statement assertions for account balances, classes of transactions and disclosures.
Answer (b) is incorrect because financial statement assertions are established for disclosures.
Answer (c) is incorrect because financial statement assertions are established for classes of transactions.
Answer (d) is incorrect because financial statement assertions are established for both classes of transactions and disclosures.


The question is, is there any way to modify the macro so I can have more spaces between the answer choices. Here is how the information should looks like.

1. (a) The requirement is to identify the categories of financial statement assertions.

Answer (a) is correct because the professional standards establish financial statement assertions for account balances, classes of transactions and disclosures.

Answer (b) is incorrect because financial statement assertions are established for disclosures.

Answer (c) is incorrect because financial statement assertions are established for classes of transactions.

Answer (d) is incorrect because financial statement assertions are established for both classes of transactions and disclosures.


Thank you all for your help!
Reply With Quote
  #2  
Old 02-15-2015, 03:20 PM
rsrasc rsrasc is offline Inserting Carriage Return Windows 7 64bit Inserting Carriage Return Office 2010 64bit
Competent Performer
Inserting Carriage Return
 
Join Date: Mar 2014
Location: Germany
Posts: 148
rsrasc is on a distinguished road
Default

Hi Greg,

When the text looks like this, your macro does not work.

1. (a) The requirement is to identify the categories of financial statement assertions. Answer (a) is correct because the professional standards establish financial statement assertions for account balances, classes of transactions and disclosures. Answer (b) is incorrect because financial statement assertions are established for disclosures. Answer (c) is incorrect because financial statement assertions are established for classes of transactions. Answer (d) is incorrect because financial statement assertions are established for both classes of transactions and disclosures


But when the text is like this your macro is working:
1. (a) The requirement is to identify the categories of financial statement assertions.
Answer (a) is correct because the professional standards establish financial statement assertions for account balances, classes of transactions and disclosures.
Answer (b) is incorrect because financial statement assertions are established for disclosures.
Answer (c) is incorrect because financial statement assertions are established for classes of transactions.
Answer (d) is incorrect because financial statement assertions are established for both classes of transactions and disclosures.

Great! I can work from here!!!!

Thanks!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Plain Text Content Control - Losing Styling on Carriage Return kintap Word 0 07-16-2014 12:43 PM
Inserting Carriage Return stop carriage return or enter key in a table Alaska1 Word 1 01-14-2013 08:48 AM
Inserting Carriage Return Coding into a macro a carriage return sinbad Word VBA 6 02-27-2012 03:51 AM
Inserting Carriage Return Paragraph (carriage) return font size revrossreddick Word 2 12-28-2011 01:33 PM
Carriage Return Help UCHelp Word 1 04-04-2010 10:11 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:55 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