check characters to the left of cursor from within a macro in Word 2007
am writing a macro to convert a set of text lines to a continuous series of lines:
Do Until chk = numrows
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeText Text:=", "
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
chk = chk + 1
Unfortunately when the growing string textwraps, the Delete 1 character action deletes the first letter of the next item.
so want to check, pres with an If then statement, whether last characters at end of line are ", " and if not, move down to the new line created by text-wrapping before doing the delete action.
Unless someone can suggest a different and smarter coding to get the same result, which is to add a comma and two spaces to the end of a line, delete the paragraph marker, go to the end of the next line down, and repeat until the last row of text.
The original text has been pasted in from excel, and then the resulting table converted to text, just to clarify where I am coming from.
Am using Word 2007 in Windows 7.
Keys to the Problem check characters to the left of cursor from within a macro in Word 2007
Better to use the Find>Replace facility to replace whatever is at the end of each line (a paragraph mark (¶) or a manual line break with a space,
If it is paragraph marks, used ^p in the find what control and if it is manual line breaks, use ^l
Manually editing the Windows registry
Caution: Unless you an advanced PC user, please do not edit the Windows registry manually.
Because of this risk, we highly recommend using a trusted registry cleaner such as SmartPCFixer Using a registry cleaner automates the process of finding invalid registry entries, missing file references (like the one causing your MACHINE_CHECK_EXCEPTION error), and broken links within the registry. A backup is automatically created before each scan, with the ability to undo any changes in a single click, protecting you against the possibility of PC damage. The best part is that repairing registry errors can also dramatically improve system speed and performance.
- Click the Start button.
- Type "command" in the search box... DO NOT hit ENTER yet!
- While holding CTRL-Shift on your keyboard, hit ENTER.
- You will be prompted with a permission dialog box.
- Click Yes.
- A black box will open with a blinking cursor.
- Type "regedit" and hit ENTER.
- In the Registry Editor, select the Error 0x9C-related key (eg. Windows Operating System) you want to back up.
- From the File menu, choose Export.
- In the Save In list, select the folder where you want to save the Windows Operating System backup key.
- In the File Name box, type a name for your backup file, such as "Windows Operating System Backup".
- In the Export Range box, be sure that "Selected branch" is selected.
- Click Save.
- The file is then saved with a .reg file extension.
- You now have a backup of your MACHINE_CHECK_EXCEPTION-related registry entry.
The next steps in manually editing your registry will not be discussed in this article due to the high risk of damaging your system. If you would like to learn more about manual registry editing, please see the links below.
Recommended Method to Repair the Problem: check characters to the left of cursor from within a macro in Word 2007:
How to Fix check characters to the left of cursor from within a macro in Word 2007 with SmartPCFixer?
1. Download SmartPCFixer . Install it on your computer. Click Scan, and it will perform a scan for your computer. The errors will be shown in the scan result.
2. After the scan is done, you can see the errors and problems which need to be fixed.
3. When the Fixing part is finished, your computer has been speeded up and the errors have been fixed
Related: How Can You Update & Download Toshiba Satellite 5105-S501 Intel PRO 10/100 Driver v.184.108.40.206,How to Update & Download Toshiba Satellite C655D-S5139 BookPlace v.2.2.7530 driver,Method to Update & Download Toshiba Satellite L655-S5073 Realtek Wireless LAN Driver v.2.00.0011,Method to Update & Download Toshiba Satellite L840-ST2N01 Sleep Utility v.1.4.0022.000104 driver,Best Way to Update & Download Toshiba Satellite Pro S300-EZ2502 Extended Tiles for Windows Mobility Center v.1.01 driver,Best Way to Download NVidia GeForce 6100 VGA Driver v.304.51 Certified,How Can You Update & Download NVidia GeForce 9300/nForce 730i VGA Driver v.310.19 Certified,Method to Download NVidia GeForce GT 330M Driver v.340.65,How Can I Update & Download NVidia GeForce GTX 590 Driver v.280.26 WHQL,Method to Download NVidia Tesla C2050 Driver v.319.17,Way to Download RealTek RTL8100C(L) Driver v.5.01,Way to Download RealTek RTL8100E Drivers v.694,Way to Update & Download RealTek RTL8101L Auto Installation Program v.6.110 driver,Method to Update & Download RealTek RTL8111G PXE and RPL ROM code v.2.58 driver,How to Update & Download RealTek RTL8411B(N) Driver v.10.003,Best Way to Update & Download ASUS A53SV nVidia Graphics Driver v.220.127.116.1186,Method to Herunterladen ASUS K75VJ Intel Rapid Storage Technology Treiber v.18.104.22.1680,How Can You Update & Download ASUS CG8580 Intel Chipset Driver v.22.214.171.1249,Method to Update & Download ASUS K41VD Intel INF Update Driver v.126.96.36.1995,Way to Update & Download ASUS Pro70T NB Probe v.3.0.0026 driver,Can't Download PP Templates Automatically To Windows 7 W/IE 8,Can't Change Drive Letter - Vista,Can't Change Homegroup Sharing Permission,Can't Connect XP Shared Printer To Win7 Except As A Local Printer.__,Can You Connect The LAN Adapter For Wii On Your Windows 7 Laptop?
Read More: Cisco VPN Issues since going to Win7 [Solved],Fast Solution to Problem: Changing permissions vs re-install of Windows 7,[Solved] Characters per Excel cell,Troubleshooting:cause of screen freeze with colored fine lines Error,How to Fix Error - Chkdsk /R stalls in cmd.exe in Windows 7 64?,Can't access c drive to open programs.,Can you use just one hard drive to store a backup disk image and restore for multiple computers?,can not install Mcafee due to Java script error,,Can Word's track changes comments print in the outside border?,cannot install old software program because computer missing indeo codec driver