How to put Objective-C in Word (Office) with syntax highlighting

I am writing documentation about the application and want to explain the code. I want to copy parts of Objective-C code from Xcode to Microsoft Word. I don’t know how to put syntax highlighting code (and possibly line numbers, too ?!) in Word.

Does anyone know a useful solution to this little problem?

+6
objective-c ms-word xcode ms-office
source share
5 answers

Copy and paste the work!

However, make sure the "Copy colors and fonts" option in Preferences>Fonts & Colors checked!

+10
source share

If you need it in Pages, you can paste it into textedit and then copy / paste from textedit to pages. I still need to find a way to paste directly into the pages and keep the text color, etc.

+7
source share

If you copy Xcode and paste into Word, you will get syntax highlighting, etc., as expected. You just need to reduce the font size to make it more readable and to avoid wrapping, etc. It would probably be nice to determine the appropriate style in Word, for example. "Code", which must have the required font size, etc. For the inserted code.

+2
source share

It supports them by default in Xcode 4. And you need to select "Use Orignal Format" in Word or Power Point.

+2
source share

If you need it in Pages, then a workaround is to copy to Xcode, paste into Word, copy it again, and then paste into pages (that is, if you have MS Word).

+1
source share

All Articles