4 Replies Latest reply on Mar 23, 2010 1:38 AM by Beliakov

    [CS3-VBA] Can i fight odd coding in stylenames?

    Beliakov Level 1

      After importing RTF-doc i got attached character styles:

      ENOI?IEE Ciae

      Caaieiaie 4 Ciae

      (i'm not sure, that wrong codin displays exactly)

      In other words, style names has kinda Turkish (or smth else) symbols.

      Problem is: Indi cannot work with this names. Indi can show these names in debugger window, but cannot address them (for change or raplace routine.

      Can i "translate" in some way such stylenames into true symbols? Or to make Indi to find this styles in common way

       

      Thanks.

        • 1. Re: [CS3-VBA] Can i fight odd coding in stylenames?
          [Jongware] Most Valuable Participant

          Your example strings show nothing special ... perhaps lost when copying/pasting.

          Can you create a screen shot of your paragraph style panel? (Don't try to attach it, when using email. Use the Web forum and the little camera button in the tool bar.)

           

          Using VBA, I think you should be able to inspect the name of each style for any "unusual" characters, i.e., with an ASCII (actually Unicode) value greater than 'z'. I don' have access to VBA right now, but the idea is:

           

          1. Per paragraph style, starting right after "Basic Paragraph Style]" (which is number 2):

          2. mySuspectName = myDocument.paragraphStyles[x].name

          3. .. per character in mySuspectName:

          4.     if ItsABadOne then

          5.      Change to '_'

          6. myDocument.paragraphStyles[x].name = mySuspectName

           

          ---

          InDesign should not really have any problem at all with weird characters in style names. I've seen them with Japanese and Chinese characters :-) It's more likely VBA simply can't handle them.

          1 person found this helpful
          • 2. Re: [CS3-VBA] Can i fight odd coding in stylenames?
            Beliakov Level 1

            Here is stylesheet after importing rtf-type doc.FromRTFtypedoc.jpg

            And here is stylesheet, how it should look like with name by correct  symbols (i got this screen after importing word-type doc).FromDOCtypedoc.jpg Unfortunately i have to import only RTF-type docs, cause in Word-type docs Index dissapers after importing.

            OK. I think that is VBA-problem. It cannot read odd symbols (from sheet above) But Indi can. I'll try to check names by symbols, as you advised.

            Thanks for ideas!

             

            P.S.

            I thought, it would be more reasonable to change style names in latin in sourse document for preventing chars "distortion".

            • 3. Re: [CS3-VBA] Can i fight odd coding in stylenames?
              [Jongware] Most Valuable Participant

              Eeew, that's a bit nastier than I thought ... It seems the correct character encoding is not honored when reading style names! Bad, bad InDesign. You may want to report this as a bug (Adobe Feature Req/Bug Report).

              • 4. Re: [CS3-VBA] Can i fight odd coding in stylenames?
                Beliakov Level 1

                OK, thanks for help.