Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-26-2024, 08:07 AM
annguye2 annguye2 is offline Copy and paste a Document property Mac OS X Copy and paste a Document property Office 2021
Novice
Copy and paste a Document property
 
Join Date: Jul 2024
Posts: 22
annguye2 is on a distinguished road
Default Copy and paste a Document property

Good morning, Everyone.

I'm having the issue of copying and pasting the borderlines (above and below) the Doc's properties (Publish Date) .. Can anyone please help?


Here is what it looks like
110520.png

Thanks,
An Nguyen
Reply With Quote
  #2  
Old 08-26-2024, 08:33 AM
Italophile Italophile is online now Copy and paste a Document property Windows 11 Copy and paste a Document property Office 2021
Expert
 
Join Date: Mar 2022
Posts: 554
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

The borders are not part of the content control. Did you insert the content control in a table?
Reply With Quote
  #3  
Old 08-26-2024, 09:08 AM
annguye2 annguye2 is offline Copy and paste a Document property Mac OS X Copy and paste a Document property Office 2021
Novice
Copy and paste a Document property
 
Join Date: Jul 2024
Posts: 22
annguye2 is on a distinguished road
Default

It is part of a document that I need to copy and paste to new document.
Is that answering the question?

More details:
- need to copy "Publish Date" property the has 2 border-lines (above and below) as seen in attachment
- and paste to replace the "Publish Date" property without 2 border-lines (above and below) of a new document.
- they both has different FRONT format.


Thanks,
An Nguyen
Reply With Quote
  #4  
Old 08-26-2024, 09:56 AM
Italophile Italophile is online now Copy and paste a Document property Windows 11 Copy and paste a Document property Office 2021
Expert
 
Join Date: Mar 2022
Posts: 554
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

Quote:
Originally Posted by annguye2 View Post
It is part of a document that I need to copy and paste to new document.
Is that answering the question?
No, it is not.

To copy the borders you need to know where the borders come from so that you know what to copy.
Are they part of a table?
Are they part of a paragraph style?
Have they been added manually to the text?

If not part of a table you'll need to copy the entire paragraph that the content control is in.
Reply With Quote
  #5  
Old 08-26-2024, 10:42 AM
annguye2 annguye2 is offline Copy and paste a Document property Mac OS X Copy and paste a Document property Office 2021
Novice
Copy and paste a Document property
 
Join Date: Jul 2024
Posts: 22
annguye2 is on a distinguished road
Default

Both documents are opened from templates, and they have in different Header, Footer, and Publish Date in format (color font style etc.).

"Are they part of a table?
Are they part of a paragraph style?
Have they been added manually to the text?"

How do I find out the answer for one of your questions above?

Thanks,
An Nguyen
Reply With Quote
  #6  
Old 08-27-2024, 05:10 AM
Italophile Italophile is online now Copy and paste a Document property Windows 11 Copy and paste a Document property Office 2021
Expert
 
Join Date: Mar 2022
Posts: 554
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

Given that you have posted this question in the VBA forum I assume that you are attempting to write code to do this.

Why are you attempting to write code before you even know how to use Word?
How can you expect to successfully automate an application that you don't know how to use?
Reply With Quote
  #7  
Old 08-27-2024, 06:17 AM
annguye2 annguye2 is offline Copy and paste a Document property Mac OS X Copy and paste a Document property Office 2021
Novice
Copy and paste a Document property
 
Join Date: Jul 2024
Posts: 22
annguye2 is on a distinguished road
Default

good morning.

Very good question there.
I know very basic about word before entering into this task with VBA
it's the job, and I must find the way to challenge it.
And I am sorry for having some kind of ** stupid ** questions so far.

Thanks,
An Nguyen
Reply With Quote
  #8  
Old 08-27-2024, 06:33 AM
Italophile Italophile is online now Copy and paste a Document property Windows 11 Copy and paste a Document property Office 2021
Expert
 
Join Date: Mar 2022
Posts: 554
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

They're not stupid questions. I'm just concerned that you are attempting to perform an expert level task when you are still only a novice. It is like attempting to run before you've learned to crawl.

VBA code simply automates the Office applications, so it is imperative that you have a good grounding in how those applications work and how they are used.

As I have just realised that you are using macOS I am not going to be able to help you as I don't have access to a mac version of Word to guide you through the interface.

As it is for your job, do you have any co-workers with a better knowledge of Word that can guide you?
Reply With Quote
  #9  
Old 08-27-2024, 06:38 AM
annguye2 annguye2 is offline Copy and paste a Document property Mac OS X Copy and paste a Document property Office 2021
Novice
Copy and paste a Document property
 
Join Date: Jul 2024
Posts: 22
annguye2 is on a distinguished road
Default

Good news.
I went through all your suggestions, and found that Copy the entire Paragraph works
That's awesome.

Thanks!!!
Reply With Quote
  #10  
Old 08-27-2024, 06:46 AM
annguye2 annguye2 is offline Copy and paste a Document property Mac OS X Copy and paste a Document property Office 2021
Novice
Copy and paste a Document property
 
Join Date: Jul 2024
Posts: 22
annguye2 is on a distinguished road
Default

Quote:
Originally Posted by Italophile View Post
They're not stupid questions. I'm just concerned that you are attempting to perform an expert level task when you are still only a novice. It is like attempting to run before you've learned to crawl.

VBA code simply automates the Office applications, so it is imperative that you have a good grounding in how those applications work and how they are used.

As I have just realised that you are using macOS I am not going to be able to help you as I don't have access to a mac version of Word to guide you through the interface.

As it is for your job, do you have any co-workers with a better knowledge of Word that can guide you?
No Sir/Madam.

I'd had never worked with MS WORD VBA. Also with Word, let say I am a user and more like a reader than a creator.
No one in the team knows Word-VBA. I have to self starting from ground zero. picking up piece by piece and put it together.
With you help so far, I've made the application runs and works for the initial version.

This copying paths are for the next level.
By the way. I am having my Laptop with Win11 now.

Thanks,
An Nguyen
Reply With Quote
  #11  
Old 08-27-2024, 08:01 AM
Italophile Italophile is online now Copy and paste a Document property Windows 11 Copy and paste a Document property Office 2021
Expert
 
Join Date: Mar 2022
Posts: 554
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

I wasn't suggesting that you would have colleagues that know Word VBA, but you may have colleagues that have more experience of using Word to create documents. It is their knowledge that you need to gain.

Your first task should be to examine the templates you need to work with in the Word UI.

If your cursor is in a table you will see two extra tabs in the ribbon, Table Design and Table Layout. In this case you may need to copy the table. You should also see Range.Information property (Word) | Microsoft Learn

To check whether the borders are part of the style you will need to display the styles pane (Alt+Ctrl+Shift+S) where you will see the style in use at the cursor position highlighted. Right click on the style name and choose Modify. In the dialog click Format then Borders. If the style has borders you will see them.

If the borders have been added manually you can check the Borders and Shading dialog.

In either of the last two cases you will probably need to copy the entire paragraph. It's difficult to say for certain as your screenshot doesn't show anything useful.
Attached Images
File Type: png Screenshot 2024-08-27 154823.png (36.3 KB, 15 views)
Reply With Quote
  #12  
Old 08-27-2024, 08:44 AM
annguye2 annguye2 is offline Copy and paste a Document property Mac OS X Copy and paste a Document property Office 2021
Novice
Copy and paste a Document property
 
Join Date: Jul 2024
Posts: 22
annguye2 is on a distinguished road
Default

Oh My..

Thank you so much for the details.
I've found that there's no table in the template, and the borders are really in style.

Also, sorry for missing information on the screenshot since i need to protect the internal detail of the project.

Your helps have been appreciated.

Thanks,
An Nguyen
Reply With Quote
  #13  
Old 08-27-2024, 09:37 AM
Italophile Italophile is online now Copy and paste a Document property Windows 11 Copy and paste a Document property Office 2021
Expert
 
Join Date: Mar 2022
Posts: 554
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

You can avoid use of the clipboard by using Range.FormattedText property (Word) | Microsoft Learn
Reply With Quote
  #14  
Old 08-27-2024, 01:16 PM
annguye2 annguye2 is offline Copy and paste a Document property Mac OS X Copy and paste a Document property Office 2021
Novice
Copy and paste a Document property
 
Join Date: Jul 2024
Posts: 22
annguye2 is on a distinguished road
Default

Thanks!!! i will give it a try.
Reply With Quote
  #15  
Old 08-29-2024, 10:50 AM
annguye2 annguye2 is offline Copy and paste a Document property Mac OS X Copy and paste a Document property Office 2021
Novice
Copy and paste a Document property
 
Join Date: Jul 2024
Posts: 22
annguye2 is on a distinguished road
Default

Quote:
Originally Posted by Italophile View Post
You can avoid use of the clipboard by using Range.FormattedText property (Word) | Microsoft Learn
Thank so much for your suggestion.
it's work nicely with original format from the source.

-An
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to copy and paste answers from the end of the document punk1234567890 Word VBA 1 02-21-2022 03:51 PM
Copy and paste a Document property Copy selected text from one document and paste to new document in same position on the page gasparik Word VBA 1 05-11-2020 05:41 AM
Copy and paste a Document property Error 4605 while trying to copy and paste with same document Ilmari Word VBA 2 05-05-2020 12:08 AM
Font changes when I copy/paste one document into another RobertWA Word 3 03-25-2019 06:13 AM
Is it possible to copy & paste Table of Contents out of one document into another? mikey386 Word 4 12-18-2014 08:45 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:21 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft