vba - How to apply macro after a certain page / line in a word document? -


i made macro , wanted apply in text page or right line. in image below shows how wanted apply macro, page 2 , red line, text pasted after red line.

thanks in advance help.

this button codes:

private sub commandbutton1_click() selection.find.clearformatting     selection.find.replacement.clearformatting     selection.find         .text = ".^p"         .replacement.text = "!teste!"         .forward = true         .wrap = wdfindcontinue         .format = false         .matchcase = false         .matchwholeword = false         .matchwildcards = false         .matchsoundslike = false         .matchallwordforms = false     end     selection.find.execute replace:=wdreplaceall     selection.find         .text = "^p"         .replacement.text = " "         .forward = true         .wrap = wdfindcontinue         .format = false         .matchcase = false         .matchwholeword = false         .matchwildcards = false         .matchsoundslike = false         .matchallwordforms = false     end     selection.find.execute replace:=wdreplaceall     selection.find         .text = "!teste!"         .replacement.text = ".^p"         .forward = true         .wrap = wdfindcontinue         .format = false         .matchcase = false         .matchwholeword = false         .matchwildcards = false         .matchsoundslike = false         .matchallwordforms = false     end     selection.find.execute replace:=wdreplaceall end sub  private sub commandbutton2_click() selection.wholestory     selection.paragraphformat.alignment = wdalignparagraphjustify     selection.paragraphformat         .spacebeforeauto = false         .spaceafterauto = false         .firstlineindent = centimeterstopoints(1.25)     end end sub 

enter image description here


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -