[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Reformatting Macro question

Posted on 2004-09-20
1
Medium Priority
?
254 Views
Last Modified: 2008-02-01
I have a word document that contains the following (sample only but has a large number of rows:

    ID_INDICATOR_EXT        "EXT"
    ID_INDICATOR_CAPS       "CAP"
    ID_APP_ABOUT            "Display program information, version number and copyright\nAbout"
    ID_APP_EXIT             "Quit the application; prompts to save documents\nExit"
    ID_NEXT_PANE            "Switch to the next window pane\nNext Pane"
    ID_PREV_PANE            "Switch back to the previous window pane\nPrevious Pane"

Can someone give me a macro so that the text is replaced by something like this

myarray(" ID_INDICATOR_EXT") = "EXT"
myarray("ID_INDICATOR_CAPS") =  "CAP"
myarray("ID_APP_ABOUT ") = "Display program information, version number and copyright\nAbout"
-------
-------
so on....

All help is appreciated


0
Comment
Question by:geoenvi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 2000 total points
ID: 12109863
It's reasonably simple.

Sub Reformat()
Dim para As Paragraph
Dim Text As String
Dim parts

For Each para In ActiveDocument.Paragraphs
    parts = Split(para.Range.Text, """")
    If UBound(parts) = 2 Then
        para.Range.Text = "myarray(""" & Trim$(parts(0)) & """) = """ & parts(1) & """" & parts(2)
    End If
Next para
End Sub

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is often necessary in this forum and others to illustrate Word fields as text with the field delimiters replaced with the curly brackets that the delimiters resemble when field codes are being displayed on the document. This means that the text c…
Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question