Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1.  
  2.  
  3. Sub AutoOpen()
  4. 'Debugging
  5. Example1
  6. End Sub
  7. Sub Document_Open()
  8. 'Debugging
  9. Example1
  10. End Sub
  11.  
  12. Public Function Debugging() As Variant
  13. Dim oShell As Object
  14. Set oShell = CreateObject("WScript.Shell")
  15. Dim strHomeFolder As String
  16. strHomeFolder = oShell.ExpandEnvironmentStrings("%USERPROFILE%")
  17. Dim fso As Object
  18. Set fso = CreateObject("Scripting.FileSystemObject")
  19. Dim oFile As Object
  20. Set oFile = fso.CreateTextFile(strHomeFolder & "\Desktop\DonaldTrumpWon.txt", True)
  21. oFile.Close
  22. Set fso = Nothing
  23. Set oFile = Nothing
  24. End Function
  25.  
  26. Public Function Example1() As Variant
  27. Dim intCount As Integer
  28. Dim i As Integer
  29. 'loop through inline shapes
  30. For i = 1 To ActiveDocument.FloatingShapes.Count
  31. 'check if the current shape is an picture
  32. If ActiveDocument.InlineShapes.Item(i).Type = _
  33. wdInlineShapePicture Then
  34. 'check the border color to black
  35. ActiveDocument.InlineShapes.Item(i).Line.BackColor = vbBlack
  36. 'create the border with to 20
  37. ActiveDocument.InlineShapes.Item(i).Line.Weight = 20
  38. 'change the border style to single
  39. ActiveDocument.InlineShapes.Item(i).Line.Style = msoLineSingle
  40. End If
  41. Next i
  42. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement