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

%20 in Frame.Title Should be blank

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
PaulJayD
General User
General User


Joined: 14 Sep 2007
Posts: 12

PostPosted: Fri Sep 14, 2007 7:19 am    Post subject: %20 in Frame.Title Should be blank Reply with quote

I assign the 'titleSet' to 'Open Document' event, and blanks in the filename show as '%20'.
Is there anyway to have blanks as blanks?

Thanks to anyone...

code:

Function Replace$(Source$, Rep$, New$)
'
' given a string, replace spec'd substr with spec'd substr
'
Dim n As Long
Dim c As String
For n = 1 To Len(Source$)
If Mid(Source$, n, 1) = Rep$ Then
Mid(Source$, n, 1, New$)
end if
Next n
Replace$ = Source$
End Function


sub titleSet
'
' set frame/document title to: fileid - path
'
oComp = StarDesktop.getCurrentComponent()
if (oComp.hasLocation) then
sURL = oComp.getLocation()
sFID = getFileId(sURL)
sPATH = getFilePath(sURL)
title$ = sFID & " - " & replace$(sPATH, "/", "\") & " - OpenOffice"
docattr = thisComponent.getDocumentInfo()
docattr.Title = title$
ThisComponent.CurrentController.Frame.title = title$
end if
end sub
Back to top
View user's profile Send private message
vitcaro
OOo Advocate
OOo Advocate


Joined: 20 Feb 2007
Posts: 256
Location: Italy

PostPosted: Sat Sep 15, 2007 1:14 am    Post subject: Reply with quote

File name is in URL format. If you want the plain file name, you have to use code like this:
Code:

FileName = ConvertFromUrl(oDocument.getLocation)
Back to top
View user's profile Send private message
PaulJayD
General User
General User


Joined: 14 Sep 2007
Posts: 12

PostPosted: Sat Sep 15, 2007 5:40 am    Post subject: %20 in Frame.Title Should be blank [solved] Reply with quote

Duh!
Thanks.
And I've seen that a million times ....
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 Macros and API 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