How to hit 'Enter' in Excel VBA that is controlling Publisher

Bacalhau75

New Member
Joined
Jul 9, 2014
Messages
12
Hi, I work in a large company and I've been asked to write a macro to 'find / replace' text within publisher docs to facilitate the process since there are 1000's of documents that require the same update. It's my first time working with Publisher and already learned that there is no 'Record' function and examples on Google are limited.
I got the macro working for the most part, but I'm stuck at a simple 'Sendkeys' function or possibly something using chr(10)/chr(13). ( i tried both together and excel locks up while chr(10) or chr(13) don't seem to do anything.

Part of the document contains an outline.
A. something something
Paragraph continues here
A little more blah blah

B. Something new here
Continues down here
And it ends here.

The code searches for "And it ends here." and i'm trying to replace it with =
"And it ends here.
C. Something new for bullet C
Continues down here
And it ends here"

I've been able to to replace the text, but it does not place the C as it's own bullet entry. It think it's part of B', so it looks like this.

B. Something new here
Continues down here
And it ends here.
C. Something new for bullet C
Continues down here
And it ends here"


i overcame the limitation of 255 characters for a variable, but can't figure out how to paste part of the replaced text, hit enter in order to create a new bullet ("C") and then paste the rest of the text.

Any help would be greatly appreciated.

Thanks,
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
i just noticed that after i posted my question the outline example, got 'flattened'. the letters A, B, C remain close to the edge, while the body of each bullet seems to be tabbed in 10 spaces or so.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top