Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following code opens a word document to be edited. The WordDialog is to
find and replace the text without user interaction. How do I get the Word Dialog to do this???? WordDialog.execute doesn't work. Any ideas????? Set WordApp = CreateObject("word.application") 'open Word session WordApp.Visible = True 'Word visible during operation WordApp.Activate Set WordDoc = WordApp.Documents.Open(file_path) 'open Word doc Set WordDialog = WordApp.Dialogs(wdDialogEditReplace) With WordDialog .Find = "<RIA name" .Replace = "TESTING!!!" End With On Error Resume Next WordDialog.Execute On Error GoTo Err_WordDocs Thank You, |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Dialogs ARE for user interaction. Without user interaction don't use dialogs. Record a macro in Word as you do a manual find-replace, and you'll get pretty good code for automatic find-replace. HTH. Best wishes Harald "Shawn G." skrev i melding ... The following code opens a word document to be edited. The WordDialog is to find and replace the text without user interaction. How do I get the Word Dialog to do this???? WordDialog.execute doesn't work. Any ideas????? Set WordApp = CreateObject("word.application") 'open Word session WordApp.Visible = True 'Word visible during operation WordApp.Activate Set WordDoc = WordApp.Documents.Open(file_path) 'open Word doc Set WordDialog = WordApp.Dialogs(wdDialogEditReplace) With WordDialog .Find = "<RIA name" .Replace = "TESTING!!!" End With On Error Resume Next WordDialog.Execute On Error GoTo Err_WordDocs Thank You, |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Any idea how to convert this to a find and replace without interaction?
"Harald Staff" wrote: Hi Dialogs ARE for user interaction. Without user interaction don't use dialogs. Record a macro in Word as you do a manual find-replace, and you'll get pretty good code for automatic find-replace. HTH. Best wishes Harald "Shawn G." skrev i melding ... The following code opens a word document to be edited. The WordDialog is to find and replace the text without user interaction. How do I get the Word Dialog to do this???? WordDialog.execute doesn't work. Any ideas????? Set WordApp = CreateObject("word.application") 'open Word session WordApp.Visible = True 'Word visible during operation WordApp.Activate Set WordDoc = WordApp.Documents.Open(file_path) 'open Word doc Set WordDialog = WordApp.Dialogs(wdDialogEditReplace) With WordDialog .Find = "<RIA name" .Replace = "TESTING!!!" End With On Error Resume Next WordDialog.Execute On Error GoTo Err_WordDocs Thank You, |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Figured it out, Thanks for the Help!
Set WordApp = CreateObject("word.application") 'open Word session WordApp.Visible = True 'Word visible during operation WordApp.Activate Set WordDoc = WordApp.Documents.Open(file_path) 'open Word doc With WordDoc.Content.Find .text = "<RIA name" With .Replacement .text = "testing!!!" End With .Execute Replace:=wdReplaceAll End With On Error Resume Next On Error GoTo Err_WordDocs "Shawn G." wrote: Any idea how to convert this to a find and replace without interaction? "Harald Staff" wrote: Hi Dialogs ARE for user interaction. Without user interaction don't use dialogs. Record a macro in Word as you do a manual find-replace, and you'll get pretty good code for automatic find-replace. HTH. Best wishes Harald "Shawn G." skrev i melding ... The following code opens a word document to be edited. The WordDialog is to find and replace the text without user interaction. How do I get the Word Dialog to do this???? WordDialog.execute doesn't work. Any ideas????? Set WordApp = CreateObject("word.application") 'open Word session WordApp.Visible = True 'Word visible during operation WordApp.Activate Set WordDoc = WordApp.Documents.Open(file_path) 'open Word doc Set WordDialog = WordApp.Dialogs(wdDialogEditReplace) With WordDialog .Find = "<RIA name" .Replace = "TESTING!!!" End With On Error Resume Next WordDialog.Execute On Error GoTo Err_WordDocs Thank You, |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That was fast. Good job, thanks for the feedback.
Best wishes Harald "Shawn G." skrev i melding ... Figured it out, Thanks for the Help! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need Excel count of 1 word if found in multi-word cells of column | Excel Worksheet Functions | |||
How to delete the "Insert Function Dialog Box" (dialog box only)? | Excel Worksheet Functions | |||
Print labels by using Excel data in a Word mail into word | Excel Discussion (Misc queries) | |||
Embedded word doc changed to image-need to change back to word. | Excel Discussion (Misc queries) | |||
control of dialog macro dialog box. on open | Excel Programming |