• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Change the Selected text to Upper Case

New Here ,
Dec 12, 2018 Dec 12, 2018

Copy link to clipboard

Copied

Hi, I have the below to code to select the Paragraph. But after that I need to update the selected text to UPPER CASE. Please help me getting the code for this.

var doc = app.ActiveDoc;
var flow = doc.MainFlowInDoc;
var textFrame = flow.FirstTextFrameInFlow;
var pgf = textFrame.FirstPgf;
var textRange = new TextRange ();
textRange.beg.obj = pgf; 
textRange.beg.offset = 0; 
textRange.end.obj = pgf; 
textRange.end.offset = Constants.FV_OBJ_END_OFFSET;
doc.TextSelection = textRange;

//Para got selected now i need change the paragraph to UPPERCASE without disterbing other formats

TOPICS
Scripting

Views

312

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 13, 2018 Dec 13, 2018

I am sorry about that. Use this one instead:

Fcodes ([FCodes.KBD_ALLCAP]);

Votes

Translate

Translate
Community Expert ,
Dec 12, 2018 Dec 12, 2018

Copy link to clipboard

Copied

Fcodes ([FCodes.TXT_UPPERCASE]);

Add this to the end of your code. Fcodes only work on the active, visible document. If you want to do this on an invisible document, like while you are processing a book, it will be a little more complicated.

-Rick

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 12, 2018 Dec 12, 2018

Copy link to clipboard

Copied

Hi Frameexpert,

Thanks for your response,

your code is updating the CharFmt and PgfFmt to uppercase, and the Pgf looks in uppercase. But the actual text is in lowercase only. When you copy the updated text to a notepad, it will be lowercase only. I just want to update Lowercase alphabets to uppercase alphabets without modifying its Pgf and Char formats.

It is similar to the option "ab   Ab  AB" available in the "Text Formatting" toolbar of the Framemaker application.

Please guide me how to use this option in FM Scripting.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 13, 2018 Dec 13, 2018

Copy link to clipboard

Copied

I am sorry about that. Use this one instead:

Fcodes ([FCodes.KBD_ALLCAP]);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 13, 2018 Dec 13, 2018

Copy link to clipboard

Copied

LATEST

Hi Frameexpert,

No Problem, your new code is working fine, Thanks...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines