Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 08-20-2014, 07:32 PM
n00bie-n00b n00bie-n00b is offline Insertbefore an array? help :( Windows 7 32bit Insertbefore an array? help :( Office 2007
Novice
Insertbefore an array? help :(
 
Join Date: Aug 2014
Posts: 17
n00bie-n00b is on a distinguished road
Default

hi, i (you) finally finished it, thanks for all your help sir!



can you help me with a simple "find.boarders = true insert before"? (trying to insert a character before every instance of a character border



Code:
Sub insertbefore
'
'
 Selection.find.boarders = True
 
With Selection.find.Replacement.Font
        .Size = 8
        .Color = 49407
        .Superscript = True
        .Subscript = False
    End With
    Selection.find.Execute Replace:=wdReplaceAll
End Sub
(looked online but cant seem to find out how to search for letters with a character border)
Reply With Quote
  #17  
Old 08-20-2014, 08:08 PM
macropod's Avatar
macropod macropod is offline Insertbefore an array? help :( Windows 7 64bit Insertbefore an array? help :( Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

In that case you would do better to insert the characters during the original Find/Replace, rather than after it. For example, after:
Application.ScreenUpdating = False
insert:
Dim Rng As Range
and after:
.Borders.Enable = True
insert:
Code:
    Set Rng = .Duplicate
    With Rng
      .Collapse wdCollapseStart
      .Text = ChrW(2588)
      With .Font
        .Size = 8
        .Color = 49407
        .Superscript = True
      End With
    End With
Of course, you'll want to change ChrW(2588) to reflect whatever your prefix character is.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #18  
Old 08-20-2014, 11:14 PM
n00bie-n00b n00bie-n00b is offline Insertbefore an array? help :( Windows 7 32bit Insertbefore an array? help :( Office 2007
Novice
Insertbefore an array? help :(
 
Join Date: Aug 2014
Posts: 17
n00bie-n00b is on a distinguished road
Default

hmmm, i think i broke it!

.
Code:
Sub ConnectConson2Dipthongs()
'
' ConnectConson2Dipthongs Macro
'
'
'version 2.0


     '
    Application.ScreenUpdating = False
    Dim Rng As range
    With ActiveDocument.range
        With .find
            .ClearFormatting
            .Replacement.ClearFormatting
            .Text = "[aeiouy誄btdktdkgfvθdszmnhlrwj" & ChrW(602) & ChrW(712) & ChrW(593) & ChrW(720) & ChrW(596) & ChrW(601) & ChrW(604) & ChrW(618) & ChrW(952) & ChrW(650) & ChrW(652) & "]" _
      & ChrW(9700) & _
      "[aeiouy・ & ChrW(604) & ChrW(602) & ChrW(593) & ChrW(596) & ChrW(601) & ChrW(604) & ChrW(618) & ChrW(650) & ChrW(720) & ChrW(652) & "]{1,2}"
            .Forward = True
            .Wrap = wdFindStop
            .Format = False
            .MatchWildcards = True
            .Execute
        End With
        Do While .find.Found
            .Borders.Enable = True
             Set Rng = .Duplicate
    With Rng
      .Collapse wdCollapseStart
      .Text = ChrW(9660)
      With .Font
        .Size = 8
        .Color = 49407
        .Superscript = True
      End With
    End With
  
    Application.ScreenUpdating = True
End Sub
Reply With Quote
  #19  
Old 08-21-2014, 02:21 AM
macropod's Avatar
macropod macropod is offline Insertbefore an array? help :( Windows 7 64bit Insertbefore an array? help :( Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

I provide you with code to insert; I didn't say to delete any (which is what you've done)...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #20  
Old 08-21-2014, 05:43 PM
n00bie-n00b n00bie-n00b is offline Insertbefore an array? help :( Windows 7 32bit Insertbefore an array? help :( Office 2007
Novice
Insertbefore an array? help :(
 
Join Date: Aug 2014
Posts: 17
n00bie-n00b is on a distinguished road
Default

hey, ive definitely broken it, tried to revert it, but dont have a save.



Code:
Sub ConnectConson2Dipthongs()
'
' ConnectConson2Dipthongs Macro
'
'
'version 2.0


    
    Application.ScreenUpdating = False
    Dim Rng As range

    With ActiveDocument.range
        With .find
            .ClearFormatting
            .Replacement.ClearFormatting
            .Text = "[aeiouy?btdktdkgfv?dszmnhlrwj" & ChrW(602) & ChrW(712) & ChrW(593) & ChrW(720) & ChrW(596) & ChrW(601) & ChrW(604) & ChrW(618) & ChrW(952) & ChrW(650) & ChrW(652) & "]" _
      & ChrW(9700) & _
      "[aeiouyæ" & ChrW(604) & ChrW(602) & ChrW(593) & ChrW(596) & ChrW(601) & ChrW(604) & ChrW(618) & ChrW(650) & ChrW(720) & ChrW(652) & "]{1,2}"
      
            .Forward = True
            .Wrap = wdFindStop
            .Format = False
            .MatchWildcards = True
            .Execute
        End With
        Do While .find.Found
            .Borders.Enable = True
             Set Rng = .Duplicate
    With Rng
      .Collapse wdCollapseStart
      .Text = ChrW(2588)
      With .Font
        .Size = 8
        .Color = 49407
        .Superscript = True
      End With
      
            .Collapse wdCollapseEnd
            .find.Execute
        Loop
    End With
    Application.ScreenUpdating = True
End Sub
loop without do! Anything ive missed out?

Last edited by n00bie-n00b; 08-21-2014 at 06:28 PM. Reason: changed code
Reply With Quote
  #21  
Old 08-21-2014, 07:52 PM
macropod's Avatar
macropod macropod is offline Insertbefore an array? help :( Windows 7 64bit Insertbefore an array? help :( Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try:
Code:
Sub Demo1()
Application.ScreenUpdating = False
Dim Rng As Range
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "[aeiouyæ" & ChrW(593) & ChrW(596) & ChrW(601) & ChrW(604) & ChrW(618) & ChrW(650) & ChrW(652) & "]{1,}" _
      & ChrW(9700) & _
      "[!^32-^62\?\@aeiouyæ" & ChrW(593) & ChrW(596) & ChrW(601) & ChrW(604) & ChrW(618) & ChrW(650) & ChrW(652) & "]"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = False
    .MatchWildcards = True
    .Execute
  End With
  Do While .Find.Found
    .Borders.Enable = True
    .InsertBefore "|"
    Set Rng = .Duplicate
    With Rng
      .Collapse wdCollapseStart
      .Text = ChrW(2588)
      With .Font
        .Size = 8
        .Color = 49407
        .Superscript = True
      End With
    End With
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #22  
Old 08-21-2014, 08:03 PM
n00bie-n00b n00bie-n00b is offline Insertbefore an array? help :( Windows 7 32bit Insertbefore an array? help :( Office 2007
Novice
Insertbefore an array? help :(
 
Join Date: Aug 2014
Posts: 17
n00bie-n00b is on a distinguished road
Default

Urghh!! I think i love you!

Cheers m8.
Reply With Quote
Reply

Tags
complex, connected, insert, macro, n00b



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding information from a array into a table jcorti Word VBA 4 01-10-2014 10:58 PM
Insertbefore an array? help :( Convert String Array to Integer Array from a User Input? tinfanide Excel Programming 4 12-26-2012 08:56 PM
Insertbefore an array? help :( Complex array formula andrei Excel 9 02-03-2012 03:40 AM
How to capture start and ending Ref. Nos. in an array KIM SOLIS Excel 5 09-07-2011 07:43 AM
Look up an array based on user input johnsmb Excel 2 01-07-2011 01:12 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:53 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft