![]() |
|
#4
|
|||
|
|||
|
Thanks for your replies.
I am very interested in any solution though I would much prefer to understand why it is different to write a macro in MSW2010 than MSW2003. Can you explain how I might achieve the result using Find/Replace? I rolled back to MSW2003 and the old macros all work fine as do new ones I created. I haven't tried to import the old macros into MSW2010 yet but fail to see why I can write them so easily in MSW2003 but the same instructions written to create a macro doesn't do what I typed in the record mode in MSW2010. I have copied one macro from the 2003 template to show how basic the code is: Sub Beige_M() ' ' Beige_M Macro ' Macro recorded 14/04/2015 by Mark Calamus ' Selection.Find.ClearFormatting With Selection.Find .Text = "Mark Calamus " .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Selection.MoveUp Unit:=wdLine, Count:=2 Selection.Range.ListFormat.RemoveNumbers NumberType:=wdNumberParagraph Selection.MoveDown Unit:=wdLine, Count:=2 Selection.EndKey Unit:=wdLine, Extend:=wdExtend Selection.Copy Selection.Delete Unit:=wdCharacter, Count:=1 Selection.MoveUp Unit:=wdLine, Count:=2 Selection.EndKey Unit:=wdLine Selection.TypeText Text:=vbTab Selection.PasteAndFormat (wdPasteDefault) Selection.TypeBackspace Selection.TypeText Text:=vbTab Selection.Delete Unit:=wdCharacter, Count:=1 Selection.MoveDown Unit:=wdLine, Count:=1 Selection.HomeKey Unit:=wdLine Selection.EndKey Unit:=wdLine, Extend:=wdExtend Selection.Font.Italic = wdToggle Selection.Font.Color = wdColorDarkYellow Selection.HomeKey Unit:=wdLine Selection.MoveDown Unit:=wdLine, Count:=1 End Sub As I wrote previously All I want to do is cut-n-paste a name and then a time to the lines above, then format the text written below. It seems very simple and I can and have re-written the codes with small changes in MSW2003 and they work pretty much how I want. To reiterate I think it is the 'find' (CTRL-F) part that is the problem. Any further help would be appreciated - I really want to upgrade to MSW2010! Cheers Mark Calamus |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Word 2003 is getting problems - funny characters on the screen that do not print
|
skkuchipudi | Word | 4 | 10-28-2015 09:18 AM |
Word 2013 problems with the Macros
|
boki_s78 | Word VBA | 3 | 04-23-2014 03:30 AM |
Problems with Recording Macros
|
jekronenfeld | Excel | 6 | 09-26-2013 03:07 PM |
Copy Macros from Word 2003 - Word 2007
|
ballj_35 | Word VBA | 7 | 05-05-2011 12:37 AM |
| Excel 2003 SP3 bug when running Macros | EnricoVenturi | Excel | 0 | 09-06-2009 08:11 AM |