Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Other Office > Word VBA
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Word VBA Discuss using VBA to program Word.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Word VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 4th, 2006, 07:05 AM
Registered User
Join Date: Mar 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Concatenating strings of code

I am wanting to take lines of code that I have pasted from mathtype and concatenate each of the lines in word using VBA.

This is a possible example of what I might have to start with.

<annotation encoding='MathType-MTEF'>

I want it to change into
<math><semantics><mi>a</mi><annotation encoding='MathType-MTEF'></annotation></semantics></math>

and if possible remove the <math>, <semantics> and
</math>, </semantics> tags.

I don't know much about VBA but I thought that something using the trim function may be useful when applied to each line of code. Then you could stick all of the lines together.

Does anyone have any ideas? Also is it possible to make it available by a button in word, that then creates an input prompt?

It would be excellent if you could help me out

Reply With Quote
  #2 (permalink)  
Old March 31st, 2006, 02:39 PM
Registered User
Join Date: Feb 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Regarding the first question:

to change into
<math><semantics><mi>a</mi><annotation encoding='MathType-MTEF'></annotation></semantics></math>

I think there will be a paragraph mark or line break on each and every line in your document. you can simply find and replace it.

Regarding the second question

<math>, <semantics> and
</math>, </semantics> tags

Similar to the first one, just find and replace it.

For these both options try to record the macro (Goto tools -> macro -> record new macro). so that you can learn better. there are so many options available in find and replace.

if you need more help please let me know.



Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
concatenating records rashi Access VBA 9 November 6th, 2008 05:07 PM
Concatenating like records pvasudevan SQL Server 2000 35 August 14th, 2008 09:28 AM
Concatenating many XML files srivalli9 XML 4 March 30th, 2006 03:05 AM
concatenating arrays allee_man BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 August 19th, 2005 08:55 AM
Concatenating many XML files srivalli9 J2EE 0 November 12th, 2003 03:14 PM

All times are GMT -4. The time now is 04:31 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.