Excel string into Word for layout changes and Print
Excel string into word for layout changes and print.
I am trying to open a file in word. The code will be run from an excell workbook.
I have been able to open the htm file from excel though there are a heap of issues that i would like to fix.
1 The word file will stay as a hidden object (wont show on screen) unless i do somethink to the sheet. eg
Code:
Set wrdApp = CreateObject("Word.Application")
Set WrdDoc = wrdApp.Documents.Open("C:\tab1.htm")
'without this it stays hidden
WrdDoc.CheckSpelling
Ok why i want this is i have a html string that will be emailed and i would like to pass this into word so the final layout can have lines, spacing played with before printing out the sheet as a mail version.
2. I need to have a buttons within the word application. Im only conserned with office 2007, So i though of creating a new GUI (ribbons) for a word doc that has a print button (this will save at time of print) a view button becouse word will open the file in web view im only conserned with print view(unless this can be hard coded in ) and a font and spellcheeker.
The problem here is if i pass the html string into word it sees it as being plain text. though if saved as htm it opes good. is there any trick that can get around this.
also part of the file i would like to be disallow the user from being able to edit or rearrange. the desired disallowed part makes up the post address and returnsender. if they get changed it will not go into the envelope correctly. This amounts for about 1/3 of the 1st page and is always the same end place if that helps.
any advice on this would help alot.
thankyou.
David Rennie
re: Excel string into Word for layout changes and Print
hi David,
1) Just a guess - try something like
Code:
wrdapp.visible = true/false
Or try recording your actions in Word (so you can use Intellisense or the Object Browser to identify the right property/method to use) & test it back in Excel.
2) I'm not sure what you're trying to edit (can it be done within excel before passing to Word?) but you may find something useful on Ron's pages:
www.rondebruin.nl/sendmail.htm
http://msdn.microsoft.com/en-us/libr...ice.11%29.aspx
hth
Rob