I am trying to write a word macro that Selects everything that is Heading 2 (or any specific style), copies it and pastes it into an Excel document. Macro recording doesn't work here and I'm stumped as to the syntax for the necessary commands. Is it possible to do?
P.S. It would be really great if it could select whatever style the cursor was next to (i.e. if you click on a Heading 1 word and then run the macro it selects everything that is Heading 1) but I doubt that this is close to possible.
Thank you so much, and I hope I get some answers soon (with any luck tonight).
Pavja2
This is what I have so far (note, I have NO IDEA how to do the excel thing so if anyone knows that it would be a big help to):
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles( _
"Heading 2,Heading 2 Char Char2 Char1,Heading 2 Char1 Char Char1 Char,Heading 2 Char Char Char Char1 Char,Heading 2 Char1 Char Char Char1 Char Char1,Heading 2 Char Char Char Char Char1 Char Char,Heading 2 Char2 Char Char Char Char Char,Heading 2 Cha" _
)
Selection.Find.ParagraphFormat.Borders.Shadow = False
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Copy
So, Can anyone figure this out...? Bump...I really need answers on this...