Hi @JaredBusch you absolutely understand what i'm trying to do but I already done with this project.
but anyway thank you for your reply i really appreciate it. maybe a few weeks later i will ask again for your help. hahaha
Hi @JaredBusch you absolutely understand what i'm trying to do but I already done with this project.
but anyway thank you for your reply i really appreciate it. maybe a few weeks later i will ask again for your help. hahaha
I want to store the found text in the array. but it seem's that i put a wrong code because it only find's letter "i"
Hi Guys. this is Jun. one of @Joyfano member i would like to open a new topic about creating macro in ms word.
I am currently creating a macro in ms word but i'm having a really hard time. this is what i wanted to do:
i want to create a macro that can search a specific word or text lets say in document1.doc then store the result in an array and after that i will search again in another document lets say document2.doc using the stored result in my first search and if i find the word it will go back to document1.doc to copy the whole paragraph and paste it in document2.doc but take note that it will paste in specific location.
my code is working fine for only the first paragraph my problem is i want to do that in another paragraph. but that paragraph have different word or text.
here's my code:
Sub Mosaic1()
'
Dim MyAr() As String
Dim i As Long
i = 0
Selection.Find.ClearFormatting
With Selection.Find
.Text = "\webfiles*?.pdf"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
ReDim Preserve MyAr(i)
MyAr(i) = Selection
i = i + 1
Windows( _
"Document2.doc" _
).Activate
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(i)"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCharacter, Count:=21
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=29
Windows("Document1").Activate
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.MoveUp Unit:=wdLine, Count:=2, Extend:=wdExtend
Selection.Cut
Windows( _
"Document2.doc" _
).Activate
Selection.PasteAndFormat wdPasteDefault
Selection.TypeParagraph
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=4
Windows("Document1").Activate
Selection.MoveDown Unit:=wdLine, Count:=1
End Sub