| View previous topic :: View next topic |
| Author |
Message |
White_Dragoon General User


Joined: 29 Apr 2006 Posts: 7
|
Posted: Sun Apr 30, 2006 7:00 am Post subject: Changing DOCUMENT variable with Macro |
|
|
Hey guys!
I have a quick question to you =). I'm working over OO.o Writer
I set a variable with:
Insert > Fields > Other > Variable tab
How can I change the value of that variable with a macro?
I want to put a button and when I push the button, activate the macro and that macro change the value of my variable. But what are the instructions needed for do that?
I tryed the next:
1.- I set a document variable named v1 = 16, (with Insert > Fields > Other > Variable tab)
2.- I created a macro module, with a Sub named macro1
3.- In the macro I put
| Code: | sub macro1
dim document as object
dim dispatcher as object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
print v1
end sub |
4.- When I run the macro, I get a blank msgbox, because v1 in the macro is a totally differente variable than v1 of my document.
Do you have an idea?
Thanks _________________ Another newb bits the dust
Running OO.o 2.0 over Windows XP SP2 |
|
| Back to top |
|
 |
probe1 Moderator


Joined: 18 Aug 2004 Posts: 2478 Location: Chonburi Thailand Asia
|
|
| Back to top |
|
 |
White_Dragoon General User


Joined: 29 Apr 2006 Posts: 7
|
Posted: Sun Apr 30, 2006 11:58 am Post subject: |
|
|
Thanks probe1. The 2nd link was in special useful. But I have a problem with a posted code in there: Do you know where can I found the properties and methods of the objects used in Basic?
And yes, I promise use the search option the next time
Thanks =) _________________ Another newb bits the dust
Running OO.o 2.0 over Windows XP SP2 |
|
| Back to top |
|
 |
White_Dragoon General User


Joined: 29 Apr 2006 Posts: 7
|
|
| Back to top |
|
 |
|