kcvinu Posted October 29, 2015 Posted October 29, 2015 Hi all,I need to set a word document's left, right indents programatically. Say, when i press Alt+L, then left indent should go to a specific location. And when i press Alt+R, then right indent should go to a specific location. I have searched a lot in the members of Range object. But couldn't find anything related to indents. My assumption is that, there is a property in range object like this- "$Range.LeftIndent = 3.5" and "$Range.RightIndent = 5.5" I need help. I am struggling. Spoiler My Contributions Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language. UDF Link Viewer --- A tool to visit the links of some most important UDFs Includer_2 ----- A tool to type the #include statement automatically Digits To Date ----- date from 3 integer values PrintList ----- prints arrays into console for testing. Alert ------ An alternative for MsgBox MousePosition ------- A simple tooltip display of mouse position GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function Access_UDF -------- An UDF for working with access database files. (.*accdb only)
kcvinu Posted October 29, 2015 Author Posted October 29, 2015 (edited) Um, got a hint. "Range.ParagraphFormat.Tabstops" Let me check it.Edit. I have got ParagraphFormat.TabIndent() for left indent. But what is for right indent ?Edit2 - How can i use "InchesToPoints" in AutoIt ? Edited October 29, 2015 by kcvinu Spoiler My Contributions Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language. UDF Link Viewer --- A tool to visit the links of some most important UDFs Includer_2 ----- A tool to type the #include statement automatically Digits To Date ----- date from 3 integer values PrintList ----- prints arrays into console for testing. Alert ------ An alternative for MsgBox MousePosition ------- A simple tooltip display of mouse position GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function Access_UDF -------- An UDF for working with access database files. (.*accdb only)
water Posted October 29, 2015 Posted October 29, 2015 I'm not sure but I think it's a method of the application or document object. kcvinu 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
kcvinu Posted October 29, 2015 Author Posted October 29, 2015 @water , Now, left side indent is ok. I need to find out how to set the right side indent . Spoiler My Contributions Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language. UDF Link Viewer --- A tool to visit the links of some most important UDFs Includer_2 ----- A tool to type the #include statement automatically Digits To Date ----- date from 3 integer values PrintList ----- prints arrays into console for testing. Alert ------ An alternative for MsgBox MousePosition ------- A simple tooltip display of mouse position GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function Access_UDF -------- An UDF for working with access database files. (.*accdb only)
PACaleala Posted October 30, 2015 Posted October 30, 2015 News flash: there is no right indent !Most likely you are thinking in terms of left and right margins (page setup).Re-read second half of post #3.
kcvinu Posted October 30, 2015 Author Posted October 30, 2015 (edited) Atlast i got it. $wRange.ParagraphFormat.RightIndent = 230So simpleEdit. Only drawback of this method is that, it uses point instead of inches. Edited October 30, 2015 by kcvinu Spoiler My Contributions Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language. UDF Link Viewer --- A tool to visit the links of some most important UDFs Includer_2 ----- A tool to type the #include statement automatically Digits To Date ----- date from 3 integer values PrintList ----- prints arrays into console for testing. Alert ------ An alternative for MsgBox MousePosition ------- A simple tooltip display of mouse position GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function Access_UDF -------- An UDF for working with access database files. (.*accdb only)
water Posted October 31, 2015 Posted October 31, 2015 (edited) You might want to use the methods of the Word application object or the following functions to translate from/to points:Func CentimetersToPoints($iValue) Return ($iValue * 28.35) EndFunc ;==>CentimetersToPoints Func InchesToPoints($iValue) Return ($iValue * 72) EndFunc ;==>InchesToPoints Func LinesToPoints($iValue) Return ($iValue * 12) EndFunc ;==>LinesToPoints Func PicasToPoints($iValue) Return ($iValue * 12) EndFunc ;==>PicasToPoints Func PointsToCentimeters($iValue) Return ($iValue / 28.35) EndFunc ;==>CentimetersToPoints Func PointsToInches($iValue) Return ($iValue / 72) EndFunc ;==>InchesToPoints Func PointsToLines($iValue) Return ($iValue / 12) EndFunc ;==>LinesToPoints Func PointsToPicas($iValue) Return ($iValue / 12) EndFunc ;==>PicasToPoints Edited October 31, 2015 by water kcvinu 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
kcvinu Posted October 31, 2015 Author Posted October 31, 2015 @water , Wow !. Great. I don't know how to say thanks for this. Anyway Thank you. Spoiler My Contributions Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language. UDF Link Viewer --- A tool to visit the links of some most important UDFs Includer_2 ----- A tool to type the #include statement automatically Digits To Date ----- date from 3 integer values PrintList ----- prints arrays into console for testing. Alert ------ An alternative for MsgBox MousePosition ------- A simple tooltip display of mouse position GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function Access_UDF -------- An UDF for working with access database files. (.*accdb only)
water Posted October 31, 2015 Posted October 31, 2015 Glad to be of service My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now