לגבי חיפוש מהוורד ביקשתי מצ'אט gpt והוא הביא לי את זה:
Sub OpenProgramAndPasteClipboard()
Dim programName As String
Dim clipboardText As String
' Replace "program.exe" with the name of the program you want to open
programName = "program.exe"
' Get the text from the clipboard
clipboardText = Clipboard.GetText
' Open the program
Shell (programName)
' Paste the text from the clipboard
SendKeys clipboardText
End Sub
וזה לא עובד (ניסיתי על פנקס הרשימות), מה הסיבה?
מצרף את הדיאלוג המלא:
||"
Can you write me a macro command for word that when I run it out of word, another software will open and within the other software that opens the computer will paste the text that exists in the copy board? [As if i press ctrl + v]
Here is a macro command for Word that will open another program and paste the contents of the clipboard into that program:
Copy code
Sub OpenProgramAndPasteClipboard()
Dim programName As String
Dim clipboardText As String
' Replace "program.exe" with the name of the program you want to open
programName = "program.exe"
' Get the text from the clipboard
clipboardText = Clipboard.GetText
' Open the program
Shell (programName)
' Paste the text from the clipboard
SendKeys clipboardText
End Sub
To use this macro, you will need to open the Visual Basic editor in Word and paste the code into a new module. Then, you can run the macro by going to the Macros dialog in Word and selecting the OpenProgramAndPasteClipboard macro.
Note that this macro uses the Shell and SendKeys functions, which are not always reliable and may not work on all systems. Additionally, this macro assumes that the program you want to open accepts keyboard input for pasting text. If the program does not accept keyboard input, this macro will not work."
https://chat.openai.com/chat#:~:text=Can you write,will not work.||