Author Topic: Help with Word Macro  (Read 2178 times)

0 Members and 1 Guest are viewing this topic.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Help with Word Macro
« on: December 26, 2010, 03:05:52 pm »
Hey, if anyone has any skill with Word Macros, some help would be appreciated. What I need to do is take the first N characters of every line and delete them from the document. Is there any practical way to do this?

Thanks for any replies.
« Last Edit: December 26, 2010, 03:06:04 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Broseph Radson

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 295
  • Rating: +20/-1
  • Its 0x1A4 somewhere
    • View Profile
Re: Help with Word Macro
« Reply #1 on: December 26, 2010, 04:27:24 pm »
Im not too experienced with macros, but i know they use mostly VB. what i would try doing first would be to move the cursor to the beginning of each row and set the cursor location as the startindex of remove (remove(cursor, N) ) but idk if thats possible. If not, you could use sendkeys. I could write a VB program that does this to a txt file but im not sure how to do it in a macro.

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Help with Word Macro
« Reply #2 on: December 26, 2010, 04:54:01 pm »
Here's a way to do it with the find and replace dialog:

  • Open the find and replace dialog
  • View the extra options and make sure "Use wildcards" is unchecked
  • Find "^p" and replace all with "^v"
  • Check "Use wildcards"
  • Find "^v[!^v]{1,x}" (x is the number of characters to remove) and replace all with "^v"
  • Uncheck "Use wildcards"
  • Find "^v" and replace all with "^p"

This works at least for my version, which is Word 2007. Tell me if this doesn't work for you.
« Last Edit: December 26, 2010, 04:56:10 pm by Runer112 »