![]() |
|
#1
|
|||
|
|||
![]()
Just started trialling 2011. Did a simple macro where I highlighted all then did some find/replace all operations. However, the latter did not occur or appear in the VBA code:
Sub Email() ' ' Email Macro ' ' Selection.WholeStory ActiveWindow.DocumentMapPercentWidth = 17 Selection.WholeStory Selection.WholeStory Selection.WholeStory Selection.ParagraphFormat.Alignment = wdAlignParagraphJustify Selection.ParagraphFormat.Alignment = wdAlignParagraphJustify Selection.Font.Size = 9 Selection.Font.Name = "Arial" End Sub Why??? |
#2
|
||||
|
||||
![]()
Hi tays01s,
Are you sure the macro recorder was on when you did the Find/Replace? If it was, the macro would probably be named 'Macro1' or something similar and would be placed in a code module named 'new macros' in either the document you're working on, or in Word's 'Normal' template, depending on the parameters you used when you did the recording.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Positive.
Selection. Whole story. came before the formatting as the end. The Find/Replace came after each: Selection. Whole story. Also I changed 'Macro1' to 'Email' as the macro name. This isn't something to do with me being on the 30 day trial??? |
#4
|
||||
|
||||
![]()
Hi tays01s,
Since the macro recorder apparently captured your 'email' sub, I doubt using a trial version has anything to do with it (unless, perhaps, the trial period has expired). For a recorded Find/Replace macro, you should see code like: Code:
Sub Macro1() ' ' Macro1 Macro ' ' Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "some text" .Replacement.Text = "^&" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = True End With Selection.Find.Execute Replace:=wdReplaceAll End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
![]()
Yes, that's what I should see and did see in the same Macro in Word X. I tried putting in the Find/Replace code and it still doesn't work.
At the moment I'm more concerned with finding out why Word doesn't work that the actual macro in question.. I've got a trial Office 2011 (mac). Records Excel macros fine. When I record a Word macro including Select all > Find/replace various bits, it all works on screen but when you try to re-run the actual Macro it fails because 'find/replace' aren't recorded within it. If I copy the contents of my original VBA from Word X to the almost empty 2011 macro, the latter works. What's going on? |
#6
|
|||
|
|||
![]() Quote:
And ctrl-y doesn't seem to repeat actions for pictures. |
#7
|
|||
|
|||
![]()
I found the problem for find/replace. If you use the normal find/replace, it doesn't work. However, if you use 'Edit>Advanced find and replace' it does record.
I wonder if there are similar problems in Word? It's a pretty bad bug. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macros | nore | Outlook | 0 | 06-01-2011 04:39 PM |
Macros | Steveg | Word VBA | 0 | 08-18-2010 04:04 PM |
![]() |
Desertwrangler | Word VBA | 6 | 06-25-2010 07:06 AM |
macros | trancetheory | Outlook | 0 | 05-11-2010 09:31 AM |
![]() |
krdzal | Excel | 1 | 04-06-2010 07:43 AM |