I wrote a number of programmes in VBA, which read and wrote to other MS programmes, without any problems.
However, I was asked to produce stand alone programmes, and purchased Visual Basic 6.0 Professional Edition.
I rewrote all of the programmes, and some have not given any trouble, but others have not worked out the way I want them to. Could you please help me?
The first problem is with a programme that reads from MS Word documents (originally this was written in VBA Word), copies one of the documents, which includes a table, opens an Outlook Template file, and pastes the copied material into an e-mail body.
Below is a portion of the code, but this code does not copy the table, just text. If I comment out ‘OutlookFile.Body = WordObj.Selection, and then hit paste in Outlook, it correctly pastes the text and table.
I only need to know how to tell my programme to Ctrl V, or equivalent.
Below is the relevant code at present.
WordObj.Selection.HomeKey Unit:=wdStory
WordObj.Selection.MoveDown Unit:=wdLine, Count:=32, Extend:=wdExtend
WordObj.Selection.CopyFormat
Set OutlookObj = CreateObject("Outlook.Application")
Set OutlookFile = OutlookObj.CreateItemFromTemplate("C:\Documents and Settings\hbcw059\Application Data\Microsoft\Templates\ICOO Bidder Approval.oft")
OutlookFile.Display
OutlookFile.Body = WordObj.Selection
Any help woukld be greatly appreciated.
john
However, I was asked to produce stand alone programmes, and purchased Visual Basic 6.0 Professional Edition.
I rewrote all of the programmes, and some have not given any trouble, but others have not worked out the way I want them to. Could you please help me?
The first problem is with a programme that reads from MS Word documents (originally this was written in VBA Word), copies one of the documents, which includes a table, opens an Outlook Template file, and pastes the copied material into an e-mail body.
Below is a portion of the code, but this code does not copy the table, just text. If I comment out ‘OutlookFile.Body = WordObj.Selection, and then hit paste in Outlook, it correctly pastes the text and table.
I only need to know how to tell my programme to Ctrl V, or equivalent.
Below is the relevant code at present.
WordObj.Selection.HomeKey Unit:=wdStory
WordObj.Selection.MoveDown Unit:=wdLine, Count:=32, Extend:=wdExtend
WordObj.Selection.CopyFormat
Set OutlookObj = CreateObject("Outlook.Application")
Set OutlookFile = OutlookObj.CreateItemFromTemplate("C:\Documents and Settings\hbcw059\Application Data\Microsoft\Templates\ICOO Bidder Approval.oft")
OutlookFile.Display
OutlookFile.Body = WordObj.Selection
Any help woukld be greatly appreciated.
john