creating word doc - setting watermark background image on main page and page numbers on the rest
1 次查看(过去 30 天)
显示 更早的评论
Hi, has anyone done this please?
I've created a word doc using
MATLAB code
wordDoc = invoke(get(wordApp, 'Documents'), 'Add');
and have populated it with tables and images etc.
I've just gone completely thick when trying to get the page numbers and an image on the first page!
Any help (or sympathy) appreciated :-)
Cheers,
Tom
0 个评论
回答(1 个)
Friedrich
2012-2-13
Hi,
one thing I do when I don't know the code for that is to let Word do a Macro and look at the generated VBA code. In that way you see the commands used to achieve what you like.
So start Word, enable Macro recording, do manually what you want, stop the Macro recording and than look at the VBA code.
This helps in 99% of the cases to get what you want.
5 个评论
Friedrich
2012-2-14
I am not 100% sure but maybe MATLAB cant resolve that code correctly. maybe try an invoke
invoke(selection.HeaderFooter.Shapes,'AddPicture','C:\Tom\background.png',false, true)
If this doesnt help, can you upload an example (word doc and your ML code) somewhere? So i can play around myself to get it running.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!