我有以下代码:
Sub AddSources()
Dim pubPage As Page
Dim pubShape As Shape
Dim hprlink As Hyperlink
Dim origAddress() As String
Dim exportFileName As String
exportFileName = "TestResume"
Dim linkSource As String
linkSource = "TestSource2"
Dim hyperLinkText As TextRange
For Each pubPage In ActiveDocument.Pages
For Each pubShape In pubPage.Shapes
If pubShape.Type = pbTextFrame Then
For Each hprlink In pubShape.TextFrame.TextRange.Hyperlinks
If InStr(hprlink.Address, "http://bleaney.ca") > 0 Then
hyperLinkText = hprlink.Range
origAddress = Split(hprlink.Address, "?source=")
hprlink.Address = origAddress(0) + "?source=" + linkSource
hprlink.Range = hyperLinkText …Run Code Online (Sandbox Code Playgroud) 有没有办法让现有的MS Publisher实例成为Microsoft.Office.Interop.Publisher.Application?
我发现了这个:
System.Diagnostics.Process.GetProcessesByName("Microsoft Publisher")
Run Code Online (Sandbox Code Playgroud)
所以我可以检查这是否已经运行,但如何将其转换为MS Publisher应用程序?所以我可以打电话Microsoft.Office.Interop.Publisher.Application.Open给例如?