| View previous topic :: View next topic |
| Author |
Message |
Fernand OOo Enthusiast

Joined: 22 Jun 2004 Posts: 142
|
Posted: Wed Dec 21, 2005 10:59 am Post subject: Undo the Form Letter query |
|
|
Everyone should know that the Mail Marge Wizard is usseless for complex task and page layouts.
Happly we have still the famous "Form Letter question" on printing ,at condition theres is a FormLeter Field present in the document. lProblem is: when the user had said that he not wonts to see this option again than he is forever in problems to uses Leter Form printing:
so:
Can we undo this never again thing with a macro using the API ?
Yes thanks to SergeM, Laurent, Danad and som peaces of code from DannyB.
anad wrote:
Under <ooo_user_install> look into Writer.xcu for:
Code:
| Code: | <prop oor:name="AskForMerge" oor:type="xs:boolean">
<value>false</value>
</prop> |
and change to:
Code:
| Code: | <prop oor:name="AskForMerge" oor:type="xs:boolean">
<value>true</value>
</prop> |
With the API it works like:
| Code: | Sub ShowAskForMerge
oConfigAccess = GetConfigAccess( "/org.openoffice.Office.Writer/FormLetter/PrintOutput", False, True )
MsgBox oConfigAccess.AskForMerge
End Sub
Sub MakeAskForMergeYES
oConfigAccess = GetConfigAccess( "/org.openoffice.Office.Writer/FormLetter/PrintOutput", True, True, False )
oConfigAccess.AskForMerge = True
oConfigAccess.commitChanges()
End Sub
Function GetConfigAccess( ByVal cNodePath As String, ByVal bWriteAccess As Boolean,Optional bEnableSync, Optional bLazyWrite ) As Object
If IsMissing( bEnableSync ) Then
bEnableSync = True
EndIf
If IsMissing( bLazyWrite ) Then
bLazyWrite = False
EndIf
oConfigProvider = GetProcessServiceManager().createInstanceWithArguments("com.sun.star.configuration.ConfigurationProvider",Array( MakePropertyValue( "enableasync", bEnableSync ) ) )
If bWriteAccess Then
cServiceName = "com.sun.star.configuration.ConfigurationUpdateAccess"
Else
cServiceName = "com.sun.star.configuration.ConfigurationAccess"
EndIf
rem Xray.Xray oConfigAccess
oConfigAccess = oConfigProvider.createInstanceWithArguments( cServiceName, Array( MakePropertyValue( "nodepath", cNodePath ), MakePropertyValue( "lazywrite", bLazyWrite ) ) )
GetConfigAccess() = oConfigAccess
End Function
Function MakePropertyValue( Optional cName As String, Optional uValue ) As com.sun.star.beans.PropertyValue
oPropertyValue = createUnoStruct( "com.sun.star.beans.PropertyValue" )
If Not IsMissing( cName ) Then
oPropertyValue.Name = cName
EndIf
If Not IsMissing( uValue ) Then
oPropertyValue.Value = uValue
EndIf
MakePropertyValue() = oPropertyValue
End Function |
Can we call the "Form Letter printing option" with a macro using the API?
So far I could find out No...
Fernand[/code] |
|
| Back to top |
|
 |
hawstom General User


Joined: 21 Dec 2004 Posts: 33 Location: Arizona, USA
|
Posted: Fri Apr 14, 2006 12:46 am Post subject: |
|
|
In my 2.0.2 for XP, here is what I had to edit:
C:\Documents and Settings\Owner\Application Data\OpenOffice.org2\user\registry\data\org\openoffice\Office\Writer.xcu
<node oor:name="printOutput">
<prop oor:name="AskForMerge" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
Close OpenOffice including the Quickstarter. Make sure it is closed. _________________ Tom Haws
Find me at Google
Find peace in sacrificial love |
|
| Back to top |
|
 |
heerenveen Newbie

Joined: 26 Jun 2007 Posts: 1
|
Posted: Tue Jun 26, 2007 12:13 am Post subject: Cant find the code needed |
|
|
I have 2 witer.xcu files one on C one on E in both files i can not find:
<node oor:name="printOutput">
<prop oor:name="AskForMerge" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
Do i need to add this to the code? |
|
| Back to top |
|
 |
JohnV Administrator

Joined: 07 Mar 2003 Posts: 8979 Location: Lexinton, Kentucky, USA
|
Posted: Tue Jun 26, 2007 7:14 am Post subject: |
|
|
heerenveen,
To the best of my knowledge AskForMerge does not appear in the file until you have
checked the box to not show the dialog again. A that point the code above will restore
the dialog so you don't need to add anything to it.
hawstom's post shows what you would have to edit if you did it manually. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|