-1

I need to type " into notepad with VBS script.

I have this code:

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "notepad"
wscript.sleep 500
WshShell.sendkeys "some "text""

But it shows an error.

Hackoo
  • 18,337
  • 3
  • 40
  • 70
Andrew
  • 33
  • 3

1 Answers1

0

You need to double up the quotes inside or you can use chr(34)

Text = "my ""example"" of doubled quotes"
Text = "use " & Chr(34) & "chr ()" & Chr(34) & " function"
NickSlash
  • 4,758
  • 3
  • 21
  • 38