DTRON04
asked on
Quick Qestion about Handling String
This should be simple one for you experts.
I need it quick so big points.
i have the follwowing string
Dim EXECUTECMD As String
EXECUTECMD = "[FilePrintSilent(""c:\tes t.pdf"")]"
But i need to make the file path/name dynamic to include in the loop so how would i deal with the "" "" quotes.
Basically i need
filename as string
filename = "c:\test.pdf" or whatever the file name is
but i need it to be recognized as the string and not "filename"
the "" quotes has me stumped.
Thanks in advance.
I need it quick so big points.
i have the follwowing string
Dim EXECUTECMD As String
EXECUTECMD = "[FilePrintSilent(""c:\tes
But i need to make the file path/name dynamic to include in the loop so how would i deal with the "" "" quotes.
Basically i need
filename as string
filename = "c:\test.pdf" or whatever the file name is
but i need it to be recognized as the string and not "filename"
the "" quotes has me stumped.
Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can insert quotes by using Chr(34)
34 is the character code for the double quote
Example:
Dim EXECUTECMD As String
Dim sFileName As String
sFileName = "c:\test.pdf"
EXECUTECMD = "[FilePrintSilent(" & Chr(34) & sFileName & Chr(34) & ")]"
MsgBox EXECUTECMD
34 is the character code for the double quote
Example:
Dim EXECUTECMD As String
Dim sFileName As String
sFileName = "c:\test.pdf"
EXECUTECMD = "[FilePrintSilent(" & Chr(34) & sFileName & Chr(34) & ")]"
MsgBox EXECUTECMD
Sharks!
Lol...
Wasn't sure if DTRON04 needed the quotes around the filename or not...
Glad to see there was more than one way to interpret his wording.
=)
Wasn't sure if DTRON04 needed the quotes around the filename or not...
Glad to see there was more than one way to interpret his wording.
=)
lol... I wasn't sure either, decided without, but now I think you got it right and I didn't :)
S
S
ASKER
thanks guys, idle was 1st and right.
sorry for the wording i had about 2 pints of coffee in my stomach that morning.
sorry for the wording i had about 2 pints of coffee in my stomach that morning.
myFileName = "c:\test.pdf"
EXECUTECMD = "[FilePrintSilent(" & myFileName & ")]"
'or if filename comes from a textbox then
Dim EXECUTECMD As String, myFileName As String
EXECUTECMD = "[FilePrintSilent(" & Text1.Text & ")]"
S