Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I....
Write an Excel macro to programmatically create a url and then print
the webpage for that URL. Then can I have Excel create a new Word document from a template and insert a bunch of Autotext? If it's possible, I'll keep digging into VBA, but if not, then at least I can stop dreaming. TIA! Eugene |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I....
The hyperlink part is straightforward, and can be done with just a few
lines of code. Dim h As Hyperlink Set h = ActiveSheet.Hyperlinks.Add(Range("A1"), "http://www.yahoo.com") h.Follow Set h = Nothing I'll let someone else answer the Word part of the question since I haven't automated Word in a whole, but "Yes" it can be done. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I....
You should be able to do the second part, too (after adding a reference to
the Word object model to your project): Dim WordApp as Word.Application Dim WordDoc as Document Documents.Open FileName:=TemplateFilePath, Format:=wdFormatOpenTemplate This opens the template, you can use the AutoTextEntry.Insert method to insert the autotext Hope you can take it from there... "Nick Hebb" wrote: The hyperlink part is straightforward, and can be done with just a few lines of code. Dim h As Hyperlink Set h = ActiveSheet.Hyperlinks.Add(Range("A1"), "http://www.yahoo.com") h.Follow Set h = Nothing I'll let someone else answer the Word part of the question since I haven't automated Word in a whole, but "Yes" it can be done. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I....
Nick, that code works, but I found another problem that prevents me
from doing what I really want to do. The cookies or whatever, for the system I'm linking to, only seems to work for the window that created it, and whatever windows it creates. Even if a web browser window is already opened and logged in, if I open another window via this code, it doesn't get the authentication from the first window. I'm sure it's just the way the cookies are setup, so I have to see if I can get the web guys to change that before I can do what I really want to do. If this was a real program, I'd use my program to manipulate that window so it logs in every time, and then goes forward to the page that I really want to get to. There isn't a way of doing that in Excel is there? I might just have to ask my boss for a copy of Delphi or Visual Studio... Eugene |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|