Skip to content

Commit

Permalink
Renamed project, got Unicode support for tag import/export working cl…
Browse files Browse the repository at this point in the history
…eanly
  • Loading branch information
brymck committed Nov 2, 2011
1 parent 1488bda commit 56b59ca
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 37 deletions.
51 changes: 29 additions & 22 deletions Modules/Tags.bas
Expand Up @@ -3,42 +3,49 @@ Option Explicit

Private TagFile As String
Private Const VimCommand As String = "gvim "
Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Const ReadLine As Integer = -2

Public Sub ExportTags()
Dim sl As Slide
Dim shp As Shape
Dim SlideIndex As Integer
Dim ShapeIndex As Integer
Dim BinaryStream As Object

Open GetTagFile() For Output As #1
SlideIndex = 1

Set BinaryStream = CreateObject("ADODB.Stream")
With BinaryStream
.Type = 2
.Charset = "utf-8"
.Open
For Each sl In ActiveWindow.Presentation.Slides
SlideIndex = SlideIndex + 1
ShapeIndex = 1

For Each shp In sl.Shapes
ShapeIndex = ShapeIndex + 1

Write #1, SlideIndex, ShapeIndex, shp.TextFrame2.TextRange.Text
.WriteText shp.TextFrame2.TextRange.Text
.WriteText vbCrLf
Next shp
Next sl
Close #1
.SaveToFile GetTagFile(), 2
End With

Shell GetTagFile(), vbNormalFocus
ShellExecute 0, vbNullString, """" & GetTagFile() & """", vbNullString, vbNullString, vbNormalFocus
End Sub

Public Sub ImportTags()
Dim SlideIndex As Integer
Dim ShapeIndex As Integer
Dim Text As String
Dim sl As Slide
Dim shp As Shape
Dim BinaryStream As Object
Dim ReadFile As String

Open GetTagFile() For Input As #1
Do While Not EOF(1)
Input #1, SlideIndex, ShapeIndex, Text
ActiveWindow.Presentation.Slides(SlideIndex - 1).Shapes(ShapeIndex - 1).TextFrame2.TextRange.Text = Text
Loop
Close #1
Set BinaryStream = CreateObject("ADODB.Stream")
With BinaryStream
.Type = 2
.Charset = "utf-8"
.Open
.LoadFromFile GetTagFile()
For Each sl In ActiveWindow.Presentation.Slides
For Each shp In sl.Shapes
shp.TextFrame2.TextRange.Text = .ReadText(ReadLine)
Next shp
Next sl
End With
End Sub

Private Function GetTagFile() As String
Expand Down
23 changes: 12 additions & 11 deletions README.md
@@ -1,5 +1,5 @@
pp\_yaku\_zen
=============
translazen
==========

Add functionality for translators to PowerPoint. Designed to increase in
usefulness as the design and wording choices of the origin authors increase in
Expand All @@ -13,13 +13,13 @@ If you haven't already, sigh as you boot up Windows, then get

For Windows, open the command prompt and copy-and-paste the following:

git clone git://github.com/brymck/pp_yaku_zen.git
copy /y "pp_yaku_zen\pp_yaku_zen.ppa" "%AppData%\Microsoft\Addins"
git clone git://github.com/brymck/translazen.git
copy /y "translazen\translazen.ppa" "%AppData%\Microsoft\Addins"

For Office for Mac, use this:

git clone git://github.com/brymck/pp_yaku_zen.git
pp_yaku_zen/install
git clone git://github.com/brymck/translazen.git
translazen/install

If it gives you a "permission denied" message, most likely you still have an
instance of PowerPoint running. If you can verify that's not the case, there's
Expand All @@ -29,16 +29,17 @@ Open PowerPoint and select the add-in:

* Windows 2007+: Office Button > PowerPoint Options > Add-Ins > Select
"PowerPoint Add-ins" in the Manage drop-down > Go... > Add New... > Select
pp\_yaku\_zen > OK > Close
* Earlier/Mac: Tools > Add-ins > Add New... > Select pp\_yaku\_zen > OK > Close
translazen > OK > Close
* Earlier/Mac: Tools > Add-ins > Add New... > Select translazen > OK > Close

Updating
--------

Go to the original directory called `pp_yaku_zen` where you first downloaded
this repository and run:
Go to the original directory called `translazen` where you first downloaded
this repository and run the following commands separately:

update
git pull origin master
copy /y "translazen.ppa" "%AppData%\Microsoft\Addins"

Or for Macs:

Expand Down
2 changes: 1 addition & 1 deletion install
@@ -1,6 +1,6 @@
#!/bin/bash
DIR="$( cd "$( dirname "$0" )" && pwd )"
PPA="pp_yaku_zen"
PPA="translazen"

function install_ppa {
if [ -d "/Applications/$1" ]; then
Expand Down
Binary file renamed pp_yaku_zen.ppa → translazen.ppa
Binary file not shown.
Binary file renamed pp_yaku_zen.ppt → translazen.ppt
Binary file not shown.
2 changes: 1 addition & 1 deletion update
@@ -1,6 +1,6 @@
#!/bin/bash
DIR="$( cd "$( dirname "$0" )" && pwd )"
PPA="pp_yaku_zen"
PPA="translazen"
cd $DIR
git pull origin master

Expand Down
2 changes: 0 additions & 2 deletions update.bat

This file was deleted.

0 comments on commit 56b59ca

Please sign in to comment.