ybolotin
11-04-2010, 07:16 AM
WinXP Pro (32-bit)
Office 2007 (Excel, Word, Outlook)
I have a table of values (in a Word .docx), and one of the columns includes formatted text.
There is a script which copies this text, and pastes into an Outlook message (Outlook uses Word as the default editor)
The following code does this:
.Cell(j, 9).Select
Selection.Copy
Set objDoc = oItem.GetInspector.WordEditor
objDoc.Content.PasteAndFormat (wdPasteDefault)
The following behavior is then observed:
For formatted text which does NOT include embedded tables:
the CONTENTS of the cell are pasted (this is what I want, the text looks as it would look if i just typed it in)For formatted text which DOES contain embedded tables (whether created in word, copied from Excel, whatever)
the CELL ITSELF (i.e. cell(j, 9)) is pasted - including borders, height and width, etc. This is made more annoying by the fact that the left edge of the cell is not at the left edge of the resulting email, but about 2 inches offscreen (so the entire left side of the final result is hidden from view)(using the other wd... options in PasteAndFormat results in either nothing getting pasted, or the same behavior being replicated)
I need this text to maintain formatting, and to be able to handle data both with and without tables.
Lacking that, I need a way to automatically adjust the position of the resultant cell-with-embedded-tables which won't break the non-embedded-table text
Any help would be vastly appreciated.
Thanks!
Office 2007 (Excel, Word, Outlook)
I have a table of values (in a Word .docx), and one of the columns includes formatted text.
There is a script which copies this text, and pastes into an Outlook message (Outlook uses Word as the default editor)
The following code does this:
.Cell(j, 9).Select
Selection.Copy
Set objDoc = oItem.GetInspector.WordEditor
objDoc.Content.PasteAndFormat (wdPasteDefault)
The following behavior is then observed:
For formatted text which does NOT include embedded tables:
the CONTENTS of the cell are pasted (this is what I want, the text looks as it would look if i just typed it in)For formatted text which DOES contain embedded tables (whether created in word, copied from Excel, whatever)
the CELL ITSELF (i.e. cell(j, 9)) is pasted - including borders, height and width, etc. This is made more annoying by the fact that the left edge of the cell is not at the left edge of the resulting email, but about 2 inches offscreen (so the entire left side of the final result is hidden from view)(using the other wd... options in PasteAndFormat results in either nothing getting pasted, or the same behavior being replicated)
I need this text to maintain formatting, and to be able to handle data both with and without tables.
Lacking that, I need a way to automatically adjust the position of the resultant cell-with-embedded-tables which won't break the non-embedded-table text
Any help would be vastly appreciated.
Thanks!