Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-20-2020, 04:52 AM
Tom1956 Tom1956 is offline What is the syntax error with .Text "^p" ? Mac OS X What is the syntax error with .Text "^p" ? Office 2016 for Mac
Novice
What is the syntax error with .Text "^p" ?
 
Join Date: Sep 2020
Posts: 3
Tom1956 is on a distinguished road
Default What is the syntax error with .Text "^p" ?

The Macro was recorded automatically by word but doesn't work because of a "syntax error" what can it be?

Sub Makro2()


'
' Makro2 Makro
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text Dialog "^p"
.Replacement.Text Dialog " "
.Forward Dialog True
.Wrap Dialog wdFindContinue
.Format Dialog False
.MatchCase Dialog False
.MatchWholeWord Dialog False
.MatchWildcards Dialog False
.MatchSoundsLike Dialog False
.MatchAllWordForms Dialog False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Reply With Quote
  #2  
Old 09-20-2020, 06:08 AM
gmaxey gmaxey is online now What is the syntax error with .Text "^p" ? Windows 10 What is the syntax error with .Text "^p" ? Office 2016
Word MVP 2003-2009
 
Join Date: May 2010
Location: Marble, NC
Posts: 1,106
gmaxey has a spectacular aura aboutgmaxey has a spectacular aura aboutgmaxey has a spectacular aura about
Default

Replace "Dialog" with "=" throughout is a start
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 09-21-2020, 01:06 PM
Tom1956 Tom1956 is offline What is the syntax error with .Text "^p" ? Mac OS X What is the syntax error with .Text "^p" ? Office 2016 for Mac
Novice
What is the syntax error with .Text "^p" ?
 
Join Date: Sep 2020
Posts: 3
Tom1956 is on a distinguished road
Default

Thanks - this works!
Do you happen to know, why Word automatically puts "Dialog" in there in the first place? Because otherwise it would empower people too much so they write too many Macros?
Reply With Quote
  #4  
Old 09-21-2020, 03:42 PM
Guessed's Avatar
Guessed Guessed is offline What is the syntax error with .Text "^p" ? Windows 10 What is the syntax error with .Text "^p" ? Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 1,944
Guessed is a name known to allGuessed is a name known to allGuessed is a name known to allGuessed is a name known to allGuessed is a name known to allGuessed is a name known to all
Default

It doesn't put Dialog there when we record this on an English language version of Word for Windows.

Your 'Makro' name implies to me that you are using a non-English version and perhaps there is a translation bug happening there. Your profile also indicates you are on a Mac and perhaps that is also a factor with the mis-translation. I have been disappointed by Mac versions of Word - it really doesn't work as well as the Windows version.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #5  
Old 09-21-2020, 04:34 PM
Charles Kenyon Charles Kenyon is offline What is the syntax error with .Text "^p" ? Windows 10 What is the syntax error with .Text "^p" ? Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 6,938
Charles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to behold
Default

One other factor is even at its best, the macro recorder is a poor reflection of the actual activity. Some things do not get recorded at all, others get mis-interpreted.
Reply With Quote
  #6  
Old 09-21-2020, 09:24 PM
Tom1956 Tom1956 is offline What is the syntax error with .Text "^p" ? Mac OS X What is the syntax error with .Text "^p" ? Office 2016 for Mac
Novice
What is the syntax error with .Text "^p" ?
 
Join Date: Sep 2020
Posts: 3
Tom1956 is on a distinguished road
Default

True, too true my Lord !
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Magic" indentation for "too-long" text-lines that are longer than one line pGrnd Word 2 04-20-2020 03:23 PM
"Word found unreadable content..." + "Word experienced an error trying to open..." onas Word 1 09-02-2019 10:52 AM
What is the syntax error with .Text "^p" ? The "body of text" for all odd-numbered pages are all "vertically-centered-aligned". keepcalmandreadabook Word 5 03-27-2017 04:08 PM
I keep getting an error when downloading email "An unknown error has occurred. 0x8004060" dbassman Outlook 0 07-15-2016 04:15 PM
Error: "Changes made were lost...reconnect with server", when switching "from" field randhurrle Outlook 2 02-25-2015 06:51 PM

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 09:44 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft