Third try - List keeps modifying the message that corrupts the macro.

classic Classic list List threaded Threaded
1 message Options
Michael D. Setzer II Michael D. Setzer II
Reply | Threaded
Open this post in threaded view
|

Third try - List keeps modifying the message that corrupts the macro.


Worked on creating a macro, and had to change it to two inputs.
Tried to do the single input, but ran into issues splitting it to change order
and convert , to -?? So simple solution to input each separate.
Hopefully, the email will have the's correctly..

Seems the Server screwed it up again. Saw the post and all the quotes and
spaces were stripped in lines with them. So not clear why the are being
changes. Option spaces and lines seem to be oK

So changing lines with quotes to use ~ and _ for spaces?
If someone knows why the list is screwing this up, or how to prevent it??

Hopefully this will get thru ok, with the changes...

sub ZT
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService(~com.sun.star.frame.DispatchHelper~)

rem ----------------------------------------------------------------------
dim sText
dim mText
dim sTime
dim eTime
rem --These lines it just eliminated the quotes??
sTime = InputBox (~Enter Cell with Start Time: Example A1~)
eTime = InputBox (~Enter Cell with End Time: Example A20~)
rem This line has quotes changed to ~, ampersands change to !, and spaces
changed to _

sText = sTime_!~,~_!_eTime
mText = eTime_!~-~_!_sTime

rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = ~StringName~

rem This line has quotes changed to ~, ampersands change to !, and spaces
changed to _
args1(0).Value =
~=DATEDIF(~_!_sText_!_~,~~d~~)~!~!~~_days_~~!TEXT((~!_mText_!~)-IN
T(~!_mText_!~),~~_H_~~~~Hours_~~~~_M_~~~~Minutes~~~~_~~)_~
 
dispatcher.executeDispatch(document, ~.uno:EnterString~, ~~, 0, args1())

end sub

+------------------------------------------------------------+
 Michael D. Setzer II - Computer Science Instructor (Retired)    
 mailto:[hidden email]                            
 mailto:[hidden email]
 Guam - Where America's Day Begins                        
 G4L Disk Imaging Project maintainer
 http://sourceforge.net/projects/g4l/
+------------------------------------------------------------+




--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy