Change Source in all files

G

Guest

I have word file (template.doc) that have several links from excel file
(template.xls). Since these files are linked every time a create a new file I
do the following steps:
1.- Open both templates and save them as a new files (sample1.doc and
sample1.xls).
2.- In the sample1.doc file I go to edit/links and click "Change Source" and
change the template.xls file to sample1.xls. Although I click the first file
and then I press
Shift" to select all file and then I click the change source. It is doing it
one by one.

I wonder if there is a way (or program) to make the change source for all
the links in one time?
Could you please help me with some advice?

Thanks in advance.
Maperalia
 
G

Guest

You could try this:

Save the document as a Web Page and then use Notepad to Change All "old
hyperlinks" to "new hyperlinks"

Then re-import the htm file to Word and re-save it back to .doc

Al
 
G

Guest

Al;
Thanks for your advice. However, I think that will be too much steps to get
the update of the links. The file is being used by people that do not have
too much computer knowledge (like me). For that reason I want to automate it.

Thanks again.
Maperalia
 
G

Guest

Al;
Thanks for answer me again and sent more information. I read the web you
sent me but does not have what I am looking for.

I wonder if can help me to adjust the program I have to save as excel and
word files from the templates files. The program save the excel file without
problem, however, the word statement I wrote does not work (see below).

Basically, this is what I need:
1.- I open the excel template (template.xls)
2.- Run the macro to save the excel file. The filename will have the
information from the cells.
3.- The same macro described in step 2 will open the word template file
(template.doc)
4.- Then will save it with the same filename I use in the step 2..

Could you please help me to make it run?
Thanks in advance.
Maperalia

P.D. Later I will figure it out to automate the change source in all files
‘*******PROGRAM STARTS****************
Option Explicit
Public Sub SaveAsTemplateFiles()
SaveExcelTemplateAsSaveAs
SaveWordTemplatelAsSaveAs
End Sub

Sub SaveExcelTemplateAsSaveAs()
Dim WO As String
Dim sFilename As String
Dim Progname As String
Dim Filename As String
Dim myDateTime As String

WO = Worksheets("summary BLR").Range("M10")
myDateTime = Format(Worksheets("summary BLR").Range("M9").Value,
"yyyymmdd")
Filename = "" & WO & "_" & myDateTime & ""
Progname = "C:\Forms\" & Filename & ".xls"
ActiveWorkbook.SaveCopyAs Progname
End Sub

'***********OPEN THE TEMPLATE WORD FILE AND SAVE **************
Sub SaveWordTemplatelAsSaveAs()
Dim wordApp As Object
Dim fNameAndPath As String
Dim Filename As String
Dim WO As String
Dim myDateTime As String

fNameAndPath = "C:\Forms\Template.doc"
Set wordApp = CreateObject("Word.Application")
wordApp.Documents.Open (fNameAndPath)
wordApp.Visible = True
wordApp.Activate

Filename = "" & WO & "_" & myDateTime & ""
ActiveDocument.SaveAs Filename:="C:\Forms\" & Filename & ".doc"

End Sub
'**********************************************************
‘*******PROGRAM ENDS****************
 
G

Guest

You seem to have an issue with transferring the information from the Excel
macro to the Word macro, perhaps that question is best posted to the
Programming section

For me, the best way to get that information would be to prompt the user to
insert it through a Message Box - I am not that experienced in macros so
perhaps others may have much better solutions.

Sorry I can't help further

Al
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top