Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.vb,microsoft.public.vb.general,microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.vb,microsoft.public.vb.general,microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.vb,microsoft.public.vb.general,microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.vb,microsoft.public.vb.general,microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.word.tables
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need to find designation for microgram on keyboard | Microsoft Word Help | |||
Typing time designation | New Users | |||
How do I remove a font from the font menu in word? | New Users | |||
Format/font when pasting and copying? | Microsoft Word Help | |||
Copying files to clipboard word 2003 | Microsoft Word Help |