AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

cRichEdit Open File

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Possemaster
Guest





PostPosted: Wed Nov 18, 2009 3:55 pm    Post subject: cRichEdit Open File Reply with quote

I cant get this to work:

If i use the following code it opens in de rich text editor correct.

Code:
cRichEdit(REdit1, "FileOpen", ("C:\test.rtf") )
Return


But i want to use the file browser to coose my file like this:

Code:
OpenFile:
FileSelectFile, SelectedFile, 3, C:\, Selecteer een Oplossing, RichText Documenten (*.rtf)
if SelectedFile =
    MsgBox, Geen bestand geselecteerd.
else
   cRichEdit(REdit1, "FileOpen", ("C:\test.rtf") )
Return


The path returns correct but it needs the quotes around it, if u put quotes around the %SelectedFile% it looks at it as plain text.

What do i do.
Back to top
engunneer



Joined: 30 Aug 2005
Posts: 7698
Location: Germany (but I only speak English)

PostPosted: Wed Nov 18, 2009 4:20 pm    Post subject: Reply with quote

Thanks for posting code

Code:
OpenFile:
FileSelectFile, SelectedFile, 3, C:\, Selecteer een Oplossing, RichText Documenten (*.rtf)
if SelectedFile =
    MsgBox, Geen bestand geselecteerd.
else
   cRichEdit(REdit1, "FileOpen", ("""" . SelectedFile  . """") )
Return


"""" is a "" in quotes. The outer " make it a string, and the inner "" is a " when inside a string.
_________________
Unless noted, all code is UNTESTED.
Answers Here: 1.(Loops, Viruses, etc.) 2.Search 3.RTFM 4.Ask for Help.
PMs will be ignored unless you are hiring me.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group