OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Macro works in one document but creates error in others

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer
View previous topic :: View next topic  
Author Message
kod65red
Newbie
Newbie


Joined: 19 Jun 2011
Posts: 3

PostPosted: Sun Jun 19, 2011 1:37 pm    Post subject: Macro works in one document but creates error in others Reply with quote

I am trying to create a macro to enter a custom format date quickly, like "19 June 2011" instead of "06/19/11." I'm using a macro since openoffice.org doesn't allow you to change the default format.

I've tried creating such a macro a few times, saving it in My Macros. It works well in the original document when I first create it; however, if I open another document or even save the first document, close it, and open it again, the macro malfunctions, producing a field like "40713.57" instead of a date. (When I rerecord the macro, I get slightly different numbers.) I've done similar things with a time macro and had the same problem. Any suggestions?
Back to top
View user's profile Send private message
floris_v
Moderator
Moderator


Joined: 12 Jul 2007
Posts: 4791
Location: Netherlands

PostPosted: Sun Jun 19, 2011 2:29 pm    Post subject: Reply with quote

See this thread in the new forum: http://user.services.openoffice.org/en/forum/viewtopic.php?f=20&t=24779
_________________
LibreOffice 3.6.3; OOo 3.4.1 on Windows Vista
Join the Official community forum - in several languages, including Nederlandstalig forum
Back to top
View user's profile Send private message
kod65red
Newbie
Newbie


Joined: 19 Jun 2011
Posts: 3

PostPosted: Sun Jun 19, 2011 2:47 pm    Post subject: Reply with quote

That is the same issue, for sure - it's not resolved there yet. Is that the forum I should be using, rather than this one?
Back to top
View user's profile Send private message
probe1
Moderator
Moderator


Joined: 18 Aug 2004
Posts: 2560
Location: Chonburi Thailand Asia

PostPosted: Sun Jun 19, 2011 3:44 pm    Post subject: Reply with quote

Using a document template with a customized date field is the easiest solution.

AutoText another one.

Or a macro that sets the format... see my Extension DateTime2
_________________
Cheers
Winfried
My Macros
DateTime2 extension: insert date, time or timestamp, formatted to your needs
Back to top
View user's profile Send private message Visit poster's website
kod65red
Newbie
Newbie


Joined: 19 Jun 2011
Posts: 3

PostPosted: Sun Jun 19, 2011 10:34 pm    Post subject: Reply with quote

Thanks. I think I resolved it more or less via the following work-around: a document template with a customized date field per your first suggestion. Not too elegant, since the date and time now appear at the top of every new default document, and the macros don't work in old documents until I add a custom-formatted date. If anyone knows a more elegant solution, let me know. I may try out your custom macro as well. Thanks!
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Mon Jun 20, 2011 8:48 am    Post subject: Reply with quote

Try the AutoText solution.
http://www.oooforum.org/forum/viewtopic.phtml?t=124595
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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