Duplicating hierarchy of accounts

gnucash_rob robcussons at gmail.com
Sun Dec 16 11:48:08 EST 2012


Hi, should have said, I'm using Windows XP.

Thanks for your help, got me on the right track and I now have what I need.
In case anyone else needs to do this in Windows, here's some vbscript to
automatically generate GUIDs and store them to the clipboard of the computer
(requires MSword to be installed), worth it if you need to do a few as I
did. 

If you paste the code below into a file called guid.vbs, then open a command
prompt and navigate to the directory where it is installed, then type:
cscript //NoLogo guid.vbs
then just paste as normal into the relevant place in your .gnucash file.
You need to make sure that you also set the parent GUIDs to the correct
values for the parent accounts.
Hope that helps someone else.

' Set what you want to put in the clipboard '
set obj = CreateObject("Scriptlet.TypeLib")
guidText= Left(Replace(Replace(Replace(Replace(obj.GUID,"{",""),"}",""),"
",""),"-",""),32)

' Declare an object for the word application '
Set objWord = CreateObject("Word.Application")

' Using the object '
With objWord
   .Visible = False     	' Don't show word '
   .Documents.Add       	' Create a document '
   .Selection.TypeText guidText ' Put text into it '
   .Selection.WholeStory    	' Select everything in the doc '
   .Selection.Copy  		' Copy contents to clipboard '
   .Quit False  		' Close Word, don't save ' 
End With

WScript.stdout.write("GUID copied to clipboard")




--
View this message in context: http://gnucash.1415818.n4.nabble.com/Duplicating-hierarchy-of-accounts-tp4658371p4658384.html
Sent from the GnuCash - User mailing list archive at Nabble.com.


More information about the gnucash-user mailing list