I would like to help to translate the following code in VBScript:
Dim Doc As Object
Dim Sheet As Object
Dim StyleFamilies As Object
Dim PageStyles As Object
Dim DefPage As Object
Doc = ThisComponent
StyleFamilies = Doc.StyleFamilies
PageStyles = StyleFamilies.getByName("PageStyles")
DefPage = PageStyles.getByName("Default")
DefPage.LeftMargin = 1000
DefPage.RightMargin = 1000
VBScript format pages
VBScript format pages
OpenOffice 4.1.2 on Windows 7
Re: VBScript format pages
Are you working with a Calc file or a Writer file?
Do you have to use VBScript and not, say, python?
Will the file you want to manipulate already be open, or will the script have to open it?
How will you identify the file you want to manipulate? By file url?
Do you have to use VBScript and not, say, python?
Will the file you want to manipulate already be open, or will the script have to open it?
How will you identify the file you want to manipulate? By file url?
OpenOffice 4.1.1 on Windows 10, HSQLDB 1.8 split database
Re: VBScript format pages
I have to write a program in VBScript that manipulate CALC file.
I don't have problems opening the file.
I have problems to pass left margin, right margin, top margin and bottom margin of the page.
I don't have problems opening the file.
I have problems to pass left margin, right margin, top margin and bottom margin of the page.
OpenOffice 4.1.2 on Windows 7
-
- Volunteer
- Posts: 1160
- Joined: Mon Oct 08, 2007 1:26 am
- Location: France, Paris area
Re: VBScript format pages
Then it is simply:
Code: Select all
' ***** VBScript *****
Dim Doc
Dim Sheet
Dim StyleFamilies
Dim PageStyles
Dim DefPage
' ( you already have Doc )
Set StyleFamilies = Doc.StyleFamilies
Set PageStyles = StyleFamilies.getByName("PageStyles")
Set DefPage = PageStyles.getByName("Default")
DefPage.LeftMargin = 1000
DefPage.RightMargin = 1000
Bernard
OpenOffice.org 1.1.5 / Apache OpenOffice 4.1.1 / LibreOffice 5.0.5
MS-Windows 7 Home SP1
OpenOffice.org 1.1.5 / Apache OpenOffice 4.1.1 / LibreOffice 5.0.5
MS-Windows 7 Home SP1