Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.vb,microsoft.public.vb.general,microsoft.public.word.tables
Mickey Ferguson Mickey Ferguson is offline
external usenet poster
 
Posts: 4
Default remove font designation before copying to clipboard?

This may not be the right forum in which to ask this question, but I'll try
here anyway. I've got a VB6 application that copies text into the
clipboard:

Clipboard.SetText sMsg

I read the documentation in MSDN, which states that if an optional, second
parameter, Format, is not supplied, the default format to copy the text is
Text (in other words, not RichText or DDE. When I then go to another
application (Microsoft Word 2003) and paste the clipboard contents into a
table, it pasts in the font from my VB app, not preserving the existing
table's font. Am I doing something wrong? Is there some property I can set
on the table in Word 2003 so that the font will remain constant? Or maybe I
need to change the way I put the text onto the clipboard within my VB app?


  #2   Report Post  
Posted to microsoft.public.vb,microsoft.public.vb.general,microsoft.public.word.tables
Herb Tyson [MVP] Herb Tyson [MVP] is offline
external usenet poster
 
Posts: 2,936
Default remove font designation before copying to clipboard?

I would think that your best option would be to use Paste Special -
Unformatted Text when pasting into Word. Something like this:

Selection.PasteSpecial link:=False, DataType:=wdPasteText

--
Herb Tyson MS MVP
Author of the Word 2007 Bible
Blog: http://word2007bible.herbtyson.com
Web: http://www.herbtyson.com


"Mickey Ferguson" wrote in message
...
This may not be the right forum in which to ask this question, but I'll
try here anyway. I've got a VB6 application that copies text into the
clipboard:

Clipboard.SetText sMsg

I read the documentation in MSDN, which states that if an optional, second
parameter, Format, is not supplied, the default format to copy the text is
Text (in other words, not RichText or DDE. When I then go to another
application (Microsoft Word 2003) and paste the clipboard contents into a
table, it pasts in the font from my VB app, not preserving the existing
table's font. Am I doing something wrong? Is there some property I can
set on the table in Word 2003 so that the font will remain constant? Or
maybe I need to change the way I put the text onto the clipboard within my
VB app?


  #3   Report Post  
Posted to microsoft.public.vb,microsoft.public.vb.general,microsoft.public.word.tables
Mickey Ferguson Mickey Ferguson is offline
external usenet poster
 
Posts: 4
Default remove font designation before copying to clipboard?

Herb, thank you very much for your reply! In the word document, I'm not
doing it programmatically. I'm just using the general purpose paste -
literally, Ctrl-V, to insert the text. Is there a way to do that
non-programmatically?

"Herb Tyson [MVP]" wrote in message
...
I would think that your best option would be to use Paste Special -
Unformatted Text when pasting into Word. Something like this:

Selection.PasteSpecial link:=False, DataType:=wdPasteText



  #4   Report Post  
Posted to microsoft.public.vb,microsoft.public.vb.general,microsoft.public.word.tables
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default remove font designation before copying to clipboard?

Edit | Paste Special as Unformatted Text.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

"Mickey Ferguson" wrote in message
...
Herb, thank you very much for your reply! In the word document, I'm not
doing it programmatically. I'm just using the general purpose paste -
literally, Ctrl-V, to insert the text. Is there a way to do that
non-programmatically?

"Herb Tyson [MVP]" wrote in message
...
I would think that your best option would be to use Paste Special -
Unformatted Text when pasting into Word. Something like this:

Selection.PasteSpecial link:=False, DataType:=wdPasteText






  #5   Report Post  
Posted to microsoft.public.word.tables
Herb Tyson [MVP] Herb Tyson [MVP] is offline
external usenet poster
 
Posts: 2,936
Default remove font designation before copying to clipboard?

Or... if you want a keystroke for it, assign the following macro to a
keystroke:

Sub PasteUnformatted()
'
' PasteUnformatted Macro
' Macro recorded May 31, 2000 by Herbert L. Tyson
'
Selection.PasteSpecial link:=False, DataType:=wdPasteText, Placement:= _
wdInLine, DisplayAsIcon:=False
End Sub


As you can see by the date, I've been using this solution for quite a long
time. ;-)

--
Herb Tyson MS MVP
Author of the Word 2007 Bible
Blog: http://word2007bible.herbtyson.com
Web: http://www.herbtyson.com


"Suzanne S. Barnhill" wrote in message
...
Edit | Paste Special as Unformatted Text.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

"Mickey Ferguson" wrote in message
...
Herb, thank you very much for your reply! In the word document, I'm not
doing it programmatically. I'm just using the general purpose paste -
literally, Ctrl-V, to insert the text. Is there a way to do that
non-programmatically?

"Herb Tyson [MVP]" wrote in message
...
I would think that your best option would be to use Paste Special -
Unformatted Text when pasting into Word. Something like this:

Selection.PasteSpecial link:=False, DataType:=wdPasteText









  #6   Report Post  
Posted to microsoft.public.word.tables
Mickey Ferguson Mickey Ferguson is offline
external usenet poster
 
Posts: 4
Default remove font designation before copying to clipboard?

Thanks, Herb (and Suzanne, previously). It turns out that I also discovered
that when I pasted the text into my table, even if I did an unformatted
method as previously recommended, it still changed the text alignment within
each cell. I've figured out a slightly different approach that really does
solve my needs. I created a macro that can format an entire table to the
exact layout I need, and it's even extensible enough that it will go through
whatever portion of the document I have selected, and apply my desired
layout (cell width, font, paragraph/cell justification, etc.) to all tables
within the selection region, leaving all non-table areas completely
untouched. So now I just go ahead and paste the normal way throughout the
entire document, and then when I'm done, I select the entire document and
apply my macro, fixing up all tables at once. Herb, your original idea of
using a macro to do what I wanted programmatically was definitely the seed
that planted the idea. Thanks to all!

"Herb Tyson [MVP]" wrote in message
...
Or... if you want a keystroke for it, assign the following macro to a
keystroke:

Sub PasteUnformatted()
'
' PasteUnformatted Macro
' Macro recorded May 31, 2000 by Herbert L. Tyson
'
Selection.PasteSpecial link:=False, DataType:=wdPasteText, Placement:=
_
wdInLine, DisplayAsIcon:=False
End Sub


As you can see by the date, I've been using this solution for quite a long
time. ;-)



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to find designation for microgram on keyboard gigimay Microsoft Word Help 7 May 13th 23 08:50 PM
Typing time designation BK New Users 19 June 4th 07 06:52 AM
How do I remove a font from the font menu in word? WordKing New Users 16 December 4th 05 05:16 AM
Format/font when pasting and copying? Michelle Microsoft Word Help 1 November 8th 05 04:25 PM
Copying files to clipboard word 2003 KM1 Microsoft Word Help 0 March 29th 05 11:41 PM


All times are GMT +1. The time now is 11:00 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"