If it is not turned on, then the variables are set to the proper codes for straight quotes. If it is, then the four variables are set to the proper ASCII codes for smart quotes. This code checks to see if the AutoFormat As You Type setting is turned on for smart quotes. If Options.AutoFormatAsYouTypeReplaceQuotes = True Then One way to do that is to use code similar to the following near the beginning of your macro: If you use the Chr function to insert the proper character, you will always have the quotes you want. There are similar differences in the codes used for apostrophes. The ASCII codes for a regular quote is 34, but a smart opening quote has a code of 147 and a closing quote is 148. If it is inserting smaller chunks of text, then it is easier to make sure that the macro is inserting the correct ASCII codes for smart quotes to begin with. This approach is the way to go if your macro inserted lots of text in the document. This may sound strange, but if you have AutoFormat As You Type set to use smart quotes, the find and replace operation will end up changing the straight quotes to smart quotes. The first is to have your macro, after it inserts all your text, do a find and replace operation to replace all quotes with quotes and apostrophes with apostrophes. There are a couple of ways you can approach a solution to this. This means that straight quotes are not changed to smart quotes if they are contained within text that is inserted by your macro. This means that any characters in the middle of the text (such as quotes or apostrophes) that would have been processed by AutoFormatting are not "caught" and processed. When you use a macro to enter the same text, it is inserted as a block, as if you pasted it in place. That means there is time for the program to check AutoFormatting and AutoCorrect and all the rest of the things that Word does to process text. Thus, if you type "this is my text," Word does its processing after each and every character. Text that is inserted by a macro is treated more like text that is pasted into a document. Text that you type is processed as each character is entered. When you insert text into a document by using a macro rather than typing, the text in each case is handled differently by Word. ![]() The problem is that if the added text contains apostrophes, those are added to the text as "straight" rather than "smart." She indicates that she has the AutoFormat As You Type setting in place that tells Word to use smart quotes instead of straight quotes, but that has no affect on the text inserted by my macros. Software is regularly updated and If this method no longer works, please email Please double check that you have to exclude citations as this is not a standard approach (Except at PGR).Mary uses macros quite a bit to add text to her documents. If you use a referencing style that uses or brackets, you can replace the () in the string of characters and it will also work. Please note: This will only work in referencing styles that use brackets for in-text citations, and will delete any additional brackets in your paper so be careful! This will delete anything in a bracket () in the paper so your word count will then be accurate.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |