Macro to Remove Just the Heading style in word vba - vba

I have a word document that was converted from a pdf. I'm trying to remove certain level 1 headings in the document, the problem is that I want to maintain the other styles. For instance, I have multiple headings that are bullet points, and I just want to remove the heading style and maintain the bullet point and bold styles. Is there a way to do this in VBA?

Related

VBA Macro for PowerPoint - Find/replace Text and Change Paragraph Color

I need to create a macro for the notes in a PowerPoint.
I need to search for a work (aka "tip") - when I find it, I need to change the word to ALL CAPS (aka TIP) and change the entire paragraph to red.
If the paragraph in the notes doesn't have the word - then it needs to stay black.
What is the best way to do this?

Traversing word-by-word in VBA through the contents of a Word textbox

Given a Microsoft Word textbox filled with formatted text, how do I use VBA to:
Iterate through the textbox content, word-by-word
At each iteration, copy/cut out that one word (including its formatting) out of the text box
Append (i.e. paste) that cut formatted word into the end of a second Microsoft Word textbox
[My situation is as follows: I have multiple continuous related texts (i.e. text + footnotes + a second set of footnotes, etc.), and my goal is to programatically lay all of that out in Word text boxes on pages of a Microsoft Word document.
I will set up the second box (that one that the words are being pasted into) to be auto-sizing, and I will then stop the "cut-paste" process once the second box gets to a certain size (which will be programatically determined based on page margins, other textboxes already occupying the page, etc.).]
I'm breaking my head over this for weeks with no results! Thanks a LOT to anyone who can send me in the right direction...

How to assign paragraph / character styles automatically in word 2010

Hi I've a 200 pg fully formatted word document. The person who had worked on it earlier had not applied any style to the whole document and he has done it manually. Though the formatting was done very neatly it has become my job to assign character/paragraph styles to each and every paragraph. Does any one know of a script which assigns character/paragraph styles automatically to the existing word 2010 document?
You'd better use Word VBA to deal with your issue.
What you should do is:
Find the style you want to replace with a style (see MSDN or some tips)
Apply style to the found selection (see this SO thread: How do I apply a style to multiple selections in Word using VBA?)
If you want to check the right style, you can record a macro and adapt it.
You can use the Find and Replace dialog to find text based on its format (e.g. Bold, Size 14) and replace it with a Style (e.g. Heading 2).
This article sums it up pretty well....
http://www.howtogeek.com/howto/microsoft-office/search-and-replace-specific-formatting-fonts-stylesetc-in-microsoft-word/

how to set a style for single words in a word document

I would like to insert single words with a specific style in a word document from a macro. Whenever I change the Style property of the Selection object or even of a range (e.g. ActiveDocument.Range(1,3)) the style of the whole paragraph is set.
How can I do this?
You're trying to apply a paragraph style.
These styles can only be applied to complete paragraphs.
If you apply a character style, it will work fine.
You can simply select the word with your mouse (click&drag with the cursor) and then select the text properties such as the font, only the selected characters will change to that font.

PickUp/Apply Paragraph Formatting in PowerPoint 2007

In PowerPoint 2007, PickUp/Apply does not capture some paragraph formatting, such as bullet formatting, when used programmatically (VBA). Adding the PickUp and Apply buttons to the Quick Access Toolbar (QAT) and trying this manually confirms this.
However, if you triple-click on a bulleted paragraph and select PickUp from the QAT, then go to another bullet in another shape, triple-click it, then select Apply from the QAT, the bullet formatting is successfully applied.
Programmatically, my approach was then to select all paragraphs in the source shape and use PickUp, then select all paragraphs in the target shape and use Apply. That didn't work. For example, I tried several variations on the following:
'oSource.TextFrame.TextRange.Select
oSource.TextFrame.TextRange.Paragraphs.Select
oSource.PickUp
'oTarget.TextFrame.TextRange.Select
oTarget.TextFrame.TextRange.Paragraphs.Select
oTarget.Apply
So, how can I make PopwerPowin 2007 apply the paragraph formatting in one shape to another, without copying each Paragraph property individually, either using PickUp/Apply or some other technique (in VBA, of course)?