Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-25-2011, 06:54 PM
Alonso Alonso is offline Macro that formats Skype IMs Windows 7 64bit Macro that formats Skype IMs Office 2007
Novice
Macro that formats Skype IMs
 
Join Date: Dec 2011
Posts: 7
Alonso is on a distinguished road
Question Macro that formats Skype IMs


Hello, I have a lot of Skype IM conversations stored in my PC and I want to copy them to a Word document and give them a nice formatting. I have hundreds of pages of conversations, so I need a macro to do this. However, preparing such a macro would take me a lot of work, in part because I know almost no Visual Basic. Is there a macro publicly available that formats this kind of text? It would save me dozens of hours. Thanks
Reply With Quote
  #2  
Old 12-27-2011, 12:32 AM
macropod's Avatar
macropod macropod is offline Macro that formats Skype IMs Windows 7 64bit Macro that formats Skype IMs Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Hi Alonso,

I'm not aware of any such software. However, a lot of what you want could probably be done via Find/Replace (which could be rolled into a macro). Even so, without knowing how Skype IM conversations are formatted or how you want them re-formatted in Word, it's impossible to advise on how you might go about it.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 01-01-2012, 06:59 PM
Alonso Alonso is offline Macro that formats Skype IMs Windows 7 64bit Macro that formats Skype IMs Office 2007
Novice
Macro that formats Skype IMs
 
Join Date: Dec 2011
Posts: 7
Alonso is on a distinguished road
Default

Hi Paul, thank you for your advice.

Quote:
Originally Posted by macropod View Post
without knowing how Skype IM conversations are formatted [...] it's impossible to advise on how you might go about it.
I know. I just had a remote hope that somebody could have already done it, thus saving me a lot of time.

Quote:
Originally Posted by macropod View Post
a lot of what you want could probably be done via Find/Replace (which could be rolled into a macro).
Yes. That's actually what I have done so far, and it's relatively straightforward. However, without some knowledge of VBA, I'm limited to very basic automation. Maybe I can reuse other macros that use the Find/Replace task in a more advanced way. Do you know of such macros?

Thanks.
Reply With Quote
  #4  
Old 01-01-2012, 10:24 PM
macropod's Avatar
macropod macropod is offline Macro that formats Skype IMs Windows 7 64bit Macro that formats Skype IMs Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Hi Alonso,

Word's Find/Replace facility is quite amenable to macro implementation - I've posted a number of such implementaions here and in other forums, some of which extend its functionality quite markedly. Still, without knowing how Skype IMs are formatted and hpw you want them re-formatted, I can't say much more than that. If you care to post some before/after examples, maybe I can help.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 01-02-2012, 03:40 PM
Alonso Alonso is offline Macro that formats Skype IMs Windows 7 64bit Macro that formats Skype IMs Office 2007
Novice
Macro that formats Skype IMs
 
Join Date: Dec 2011
Posts: 7
Alonso is on a distinguished road
Default

Hi Paul,

I attach a Word document with some text formatted with both styles: first the Skype style and then my style. I think that it gives a general idea of what I'm looking for. Anyway, I can explain it in more detail if needed.

Thanks.
Attached Files
File Type: docx Sample for the Word forum.docx (26.5 KB, 12 views)
Reply With Quote
  #6  
Old 01-02-2012, 06:53 PM
macropod's Avatar
macropod macropod is offline Macro that formats Skype IMs Windows 7 64bit Macro that formats Skype IMs Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Hi Alonso,

This should do most of what you want:
Code:
Sub Skype_Reformatter()
Application.ScreenUpdating = False
Dim Rng As Range, StrFnd As String
With ActiveDocument.Content
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "([!^13])(\[[0-9]{1,2}/[0-9]{1,2}/[0-9]{4})"
    .Replacement.Text = "^p\2"
    .Forward = True
    .Wrap = wdFindStop
    .Format = True
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = True
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    .Execute Replace:=wdReplaceAll
    .Text = "[0-9]{1,2}/[0-9]{1,2}/[0-9]{4}"
    .Replacement.Text = ""
    .Execute
  End With
  Do While .Find.Found
    StrFnd = .Text
    Set Rng = .Paragraphs.First.Range.Duplicate
    With Rng
      On Error GoTo ParaLast
      Do
        .Text = Replace(.Text, StrFnd, "")
        If InStr(.Paragraphs.Last.Next.Range.Text, StrFnd) = 2 Then
          .MoveEnd wdParagraph, 1
        Else
          Exit Do
        End If
      Loop
ParaLast:
      ActiveDocument.Sections.Add Range:=Rng, Start:=wdSectionContinuous
      .InsertBefore vbCr & Format(StrFnd, "d") & " de " & Format(StrFnd, "mmmm")
      .Paragraphs.First.Next.Style = "Heading 3"
    End With
    .Start = Rng.End
    .Find.Execute
  Loop
  .Start = 0
  With .Find
    .Text = "(\[ [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}\])"
    .Execute
  End With
  Do While .Find.Found
    With .Words.Last.Next.Words.First
      .Text = UCase(Trim(Left(.Text, 1)))
      .Font.Bold = True
    End With
    .Text = Format(Mid(.Text, 3, Len(.Text) - 4), "h:mm AMPM")
    .Font.Italic = True
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
macros, skype, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Template formats ROTECH Outlook 0 07-20-2011 09:28 PM
Macro that formats Skype IMs Help With Contracts Formats!! SaintJustin Martyr Word 6 06-20-2011 06:19 PM
Macro that formats Skype IMs Combining documents of different formats Blaie Word 1 06-04-2011 06:35 PM
Macro that formats Skype IMs Changing formats manually?? Flabbergaster Word 1 11-03-2010 02:45 AM
Macro for different file formats pengyou Office 0 04-06-2010 09:27 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:20 AM.


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